-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (75 loc) · 2.26 KB
/
Copy pathtest-action-checkout.yml
File metadata and controls
80 lines (75 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Workflow to checkout repository
name: Test action action-checkout
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # for checkout
jobs:
test-checkout-persist-credentials-default:
name: test-persist-credentials-default
runs-on: ubuntu-latest
steps:
- name: checkout-local-actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: ./action-templates/actions/action-checkout
- name: persist-credentials-default
run: |
for file in "$RUNNER_TEMP"/git-credentials-*.config
do
if [ -e "$file" ]; then
echo "Detected credential file"
exit 1
fi
done
test-checkout-persist-credentials-false:
name: test-persist-credentials-false
runs-on: ubuntu-latest
steps:
- name: checkout-local-actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: ./action-templates/actions/action-checkout
with:
persist-credentials: false
- name: persist-credentials-false
run: |
for file in "$RUNNER_TEMP"/git-credentials-*.config
do
if [ -e "$file" ]; then
echo "Detected credential file"
exit 1
fi
done
test-checkout-persist-credentials-true:
name: test-persist-credentials-true
runs-on: ubuntu-latest
steps:
- name: checkout-local-actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: ./action-templates/actions/action-checkout
with:
persist-credentials: true
- name: persist-credentials-true
run: |
for file in "$RUNNER_TEMP"/git-credentials-*.config
do
if [ ! -e "$file" ]; then
echo "Couldn't detect credential file"
exit 1
fi
done