Skip to content

Commit e4a6ab5

Browse files
authored
chore(ci): fail CI if a personal access token secret is referenced (#6919)
1 parent d7b7646 commit e4a6ab5

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

โ€Ž.github/workflows/check.ymlโ€Ž

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,21 @@ jobs:
710710
exit 1
711711
fi
712712
713+
- name: Check that no retired bot secret is referenced
714+
run: |
715+
banned='ALGOLIA_BOT_TOKEN|ALGOLIA_BOT_APP_ID|GH_PERSONAL_ACCESS_TOKEN'
716+
status=0
717+
grep -rnE "secrets\.($banned)" .github clients/*/.github templates > pat-refs.txt || status=$?
718+
if [[ -s pat-refs.txt ]]; then
719+
echo "The following retired secrets are referenced, use the GitHub App token instead:"
720+
cat pat-refs.txt
721+
exit 1
722+
fi
723+
if [[ $status -gt 1 ]]; then
724+
echo "grep could not read one of the scan paths, the check did not run"
725+
exit 1
726+
fi
727+
713728
check_green:
714729
runs-on: ubuntu-24.04
715730
timeout-minutes: 10

0 commit comments

Comments
ย (0)