Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/security-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,24 @@ jobs:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
MG_BASE_SHA: ${{ github.event.merge_group.base_sha }}
MG_HEAD_SHA: ${{ github.event.merge_group.head_sha }}
run: |
set -euo pipefail
case "$EVENT_NAME" in
pull_request)
# Scan exactly the commits this PR introduces.
echo "range=${PR_BASE_SHA}..${PR_HEAD_SHA}" >> "$GITHUB_OUTPUT"
;;
merge_group|workflow_dispatch|*)
# In the merge queue (and on manual dispatch) there is no PR diff to
# scope to; scan the full reachable history as a backstop.
merge_group)
# Scan exactly the commits this merge group introduces (#336).
# An empty range here would fall back to full history, which
# re-reports the historical #313 findings and deadlocks the queue.
echo "range=${MG_BASE_SHA}..${MG_HEAD_SHA}" >> "$GITHUB_OUTPUT"
;;
workflow_dispatch|*)
# On manual dispatch there is no PR diff to scope to; scan the
# full reachable history as a backstop.
echo "range=" >> "$GITHUB_OUTPUT"
;;
esac
Expand Down
Loading