Adding yahoo example #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Secret Scanning Status Check | |
on: | |
# workflow_dispatch: | |
pull_request: | |
types: [opened, reopened] | |
jobs: | |
Secret-Scanning-Check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install jq | |
run: sudo apt-get install jq | |
- name: Run Secret Scanning Alert Check | |
id: secrets_check | |
run: | | |
response=$(curl -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.SCAN_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${{ github.repository }}/secret-scanning/alerts) | |
echo "$response" | jq -r '.[] | select(.state!="resolved")' > state.json | |
if [ -s state.json ]; then | |
echo "::error file=state.json,line=1,col=1::Unresolved secret scanning alerts detected" | |
exit 1 | |
fi | |
shell: bash |