2020 rust : ${{ steps.filter.outputs.rust }}
2121 steps :
2222 - uses : actions/checkout@v5
23+ with :
24+ persist-credentials : false
2325 - uses : dorny/paths-filter@v3
2426 id : filter
2527 with :
4951 runs-on : ubuntu-latest
5052 steps :
5153 - uses : actions/checkout@v5
54+ with :
55+ persist-credentials : false
5256 - uses : ./.github/actions/init-env-node
5357 - run : pnpm prettier
5458
5862 runs-on : ubuntu-latest
5963 steps :
6064 - uses : actions/checkout@v5
65+ with :
66+ persist-credentials : false
6167 - uses : ./.github/actions/init-env-node
6268 - run : pnpm lint
6369
6773 runs-on : ubuntu-latest
6874 steps :
6975 - uses : actions/checkout@v5
76+ with :
77+ persist-credentials : false
7078 - uses : ./.github/actions/init-env-node
7179 - run : pnpm check
7280
7684 runs-on : ubuntu-latest
7785 steps :
7886 - uses : actions/checkout@v5
87+ with :
88+ persist-credentials : false
7989 - uses : ./.github/actions/init-env-node
8090 - run : pnpm test
8191
8999 CARGO_TERM_COLOR : always
90100 steps :
91101 - uses : actions/checkout@v5
102+ with :
103+ persist-credentials : false
92104 - run : cargo fmt --check --all
93105 - run : cargo check --workspace --all-targets
94106
@@ -102,6 +114,8 @@ jobs:
102114 CARGO_TERM_COLOR : always
103115 steps :
104116 - uses : actions/checkout@v5
117+ with :
118+ persist-credentials : false
105119 # TODO(qix-): we have to exclude the app here for now because for some
106120 # TODO(qix-): reason it doesn't build with the docs feature enabled.
107121 - run : cargo doc --no-deps --all-features --document-private-items -p gitbutler-git
@@ -114,6 +128,8 @@ jobs:
114128 runs-on : ubuntu-latest
115129 steps :
116130 - uses : actions/checkout@v5
131+ with :
132+ persist-credentials : false
117133 - uses : EmbarkStudios/cargo-deny-action@f2ba7abc2abebaf185c833c3961145a3c275caad # v2.0.13
118134 with :
119135 command : check bans licenses sources
@@ -129,6 +145,8 @@ jobs:
129145 shell : bash
130146 steps :
131147 - uses : actions/checkout@v5
148+ with :
149+ persist-credentials : false
132150 - name : Rust Cache
133151134152 with :
@@ -186,9 +204,40 @@ jobs:
186204 CARGO_TERM_COLOR : always
187205 steps :
188206 - uses : actions/checkout@v5
207+ with :
208+ persist-credentials : false
189209 - name : Rust Cache
190210191211 with :
192212 shared-key : windows-rust-testing
193213 - name : ' cargo check'
194214 run : cargo check --workspace --all-targets --features windows
215+
216+ # Check that all `actions/checkout` in CI jobs have `persist-credentials: false`.
217+ check-no-persist-credentials :
218+ runs-on : ubuntu-latest
219+
220+ env :
221+ GLOB : .github/workflows/*.@(yaml|yml)
222+
223+ steps :
224+ - uses : actions/checkout@v5
225+ with :
226+ persist-credentials : false
227+ sparse-checkout : ' .github/workflows'
228+ - name : Generate workflows list to scan
229+ run : |
230+ shopt -s extglob
231+ printf '%s\n' ${{ env.GLOB }} | grep -v .github/workflows/publish.yaml >workflows.list
232+ cat workflows.list
233+ echo "Note that publish.yaml is excluded until it's ensured to not need this feature"
234+ - name : Scan workflows
235+ run : |
236+ shopt -s extglob
237+ yq '.jobs.*.steps[]
238+ | select(.uses == "actions/checkout@*" and .with.["persist-credentials"]? != false)
239+ | {"file": filename, "line": line, "name": (.name // .uses)}
240+ | .file + ":" + (.line | tostring) + ": " + .name
241+ ' -- $(cat workflows.list) >query-output.txt
242+ cat query-output.txt
243+ test -z "$(<query-output.txt)" # Report failure if we found anything.
0 commit comments