72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
name: security
|
|
|
|
on:
|
|
merge_group:
|
|
pull_request:
|
|
push:
|
|
|
|
# Don't cancel in-progress runs: cancelling can abort the SARIF upload mid-flight,
|
|
# leaving the PR head SHA with no Code Scanning results and blocking branch protection.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
permissions:
|
|
contents: read # Required for checkout or repository metadata reads.
|
|
|
|
jobs:
|
|
pinact:
|
|
name: pinact
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read # Required for checkout or repository metadata reads.
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: suzuki-shunsuke/pinact-action@cf51507d80d4d6522a07348e3d58790290eaf0b6 # v2.0.0
|
|
with:
|
|
skip_push: "true" # validate only; fail CI on unpinned actions
|
|
|
|
zizmor:
|
|
name: zizmor
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
actions: read # required by upload-sarif to read workflow run metadata
|
|
contents: read # Required for checkout or repository metadata reads.
|
|
security-events: write # upload SARIF to Code Scanning
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
|
|
with:
|
|
persona: pedantic
|
|
|
|
security:
|
|
name: security
|
|
permissions: {}
|
|
if: always()
|
|
needs:
|
|
- pinact
|
|
- zizmor
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- name: Print all job results
|
|
env:
|
|
NEEDS_JSON: ${{ toJson(needs) }}
|
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
|
run: |
|
|
echo "'needs': ${NEEDS_JSON}"
|
|
echo "github.event_name: ${GITHUB_EVENT_NAME}"
|
|
|
|
# In the merge queue, any skipped job is a failure (everything must run).
|
|
# In PR CI, skips are allowed (e.g. fork PRs without OIDC).
|
|
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || (github.event_name == 'merge_group' && contains(needs.*.result, 'skipped')) }}
|
|
run: exit 1
|