Skip to content
Merged
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
45 changes: 3 additions & 42 deletions .github/workflows/gate-attestation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,8 @@ permissions:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
gate-attestation:
name: gate-attestation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false

- name: Verify Gate-Passed trailer
env:
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
if [ "$PR_AUTHOR" = "dependabot[bot]" ] || [ "$PR_AUTHOR" = "release-please[bot]" ]; then
echo "Trusted bot PR author: $PR_AUTHOR"
echo "Gate attestation auto-passed for trusted bot PR."
exit 0
fi

commits=$(git log --format="%H" "origin/${{ github.base_ref }}..HEAD")
if [ -z "$commits" ]; then
echo "ERROR: No commits found in PR"
exit 1
fi

found=false
for sha in $commits; do
body=$(git log -1 --format="%b" "$sha")
if echo "$body" | grep -q "^Gate-Passed:"; then
version=$(echo "$body" | grep "^Gate-Passed:" | head -1)
echo "Found gate attestation: $version"
found=true
break
fi
done

if [ "$found" = false ]; then
echo "ERROR: No Gate-Passed trailer found in any PR commit."
echo "Run the local gate and commit with the trailer."
exit 1
fi
gate:
uses: forkwright/.github/.github/workflows/gate-attestation.yml@5be130bfebd5165d3221f1896f96b5ce6e93bf9b