Don't cache git credentials in workflows (#51) #5
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: "Scan workflows" | |
on: | |
pull_request: | |
branches: | |
- "**" | |
paths: | |
# Run for changes to *any* workflow file | |
- ".github/workflows/*.yml" | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
# required for all workflows | |
security-events: write | |
# only required for workflows in private repositories | |
actions: read | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install zizmor | |
run: cargo install zizmor | |
- name: Scan workflows | |
run: | |
zizmor --format=sarif . | tee workflow-scan.sarif | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: github/codeql-action/upload-sarif@v3 | |
if: always() | |
with: | |
# Path to SARIF file relative to the root of the repository | |
sarif_file: workflow-scan.sarif |