Skip to content

Commit

Permalink
Test a CI step that will fail early with a clear message if the bot t…
Browse files Browse the repository at this point in the history
…oken is missing (external contributor)
  • Loading branch information
budak7273 committed Dec 12, 2024
1 parent 105bfa1 commit 3470dcd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ jobs:
- name: Cleanup
run: Remove-Item * -Recurse -Force -Confirm:$false -ErrorAction Ignore

- name: Check for permission to run CI
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
if: ${{ env.GH_TOKEN == '' }}
shell: bash
run: |
if [ \"$SECRET\" == \"\" ]; then
echo \"Pull requests made by users not in the organization (intentionally) can't access the CI secrets. Ignore this CI failure - the team will be building the project locally anyways to test it out." >> $GITHUB_OUTPUT
exit 1
else
echo \"Temporarily fail this case anyways as a test" >> $GITHUB_OUTPUT
exit 2
fi
- uses: actions/checkout@v2
with:
path: SML
Expand Down

0 comments on commit 3470dcd

Please sign in to comment.