|
1 | | -name: 'SigScanner Check' |
| 1 | +name: "SigScanner Check" |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
4 | 5 | merge_group: |
5 | 6 | push: |
| 7 | + branches: |
| 8 | + - develop |
6 | 9 |
|
7 | 10 | jobs: |
8 | 11 | sigscanner-check: |
| 12 | + # On pull_request, github.actor is the PR creator, so we can reliably |
| 13 | + # skip the bot's PRs. On merge_group the actor is whoever enqueued the |
| 14 | + # merge, so we skip entirely to avoid false positives. |
| 15 | + if: >- |
| 16 | + github.event_name != 'merge_group' |
| 17 | + && github.actor != 'chainlink-release-pusher[bot]' |
9 | 18 | runs-on: ubuntu-latest |
| 19 | + env: |
| 20 | + # On pull_request, github.sha is a temporary merge commit; use the |
| 21 | + # actual PR head commit so SigScanner verifies the developer's signed |
| 22 | + # commit. On push, github.sha is the real commit on develop. |
| 23 | + COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} |
10 | 24 | steps: |
11 | | - - name: "SigScanner checking ${{ github.sha }} by ${{ github.actor }}" |
| 25 | + - name: "SigScanner checking ${{ env.COMMIT_SHA }} by ${{ github.actor }}" |
12 | 26 | env: |
13 | 27 | API_TOKEN: ${{ secrets.SIGSCANNER_API_TOKEN }} |
14 | 28 | API_URL: ${{ secrets.SIGSCANNER_API_URL }} |
15 | 29 | run: | |
16 | | - echo "🔎 Checking commit ${{ github.sha }} by ${{ github.actor }} in ${{ github.repository }} - ${{ github.event_name }}" |
17 | | - CODE=`curl --write-out '%{http_code}' -X POST -H "Content-Type: application/json" -H "Authorization: $API_TOKEN" --silent --output /dev/null --url "$API_URL" --data '{"commit":"${{ github.sha }}","repository":"${{ github.repository }}","author":"${{ github.actor }}"}'` |
| 30 | + echo "🔎 Checking commit ${COMMIT_SHA} by ${GITHUB_ACTOR} in ${GITHUB_REPOSITORY} - ${GITHUB_EVENT_NAME}" |
| 31 | + CODE=$(curl \ |
| 32 | + --write-out '%{http_code}' \ |
| 33 | + -X POST \ |
| 34 | + -H "Content-Type: application/json" \ |
| 35 | + -H "Authorization: $API_TOKEN" \ |
| 36 | + --silent \ |
| 37 | + --output /dev/null \ |
| 38 | + --url "$API_URL" \ |
| 39 | + --data "{\"commit\":\"${COMMIT_SHA}\",\"repository\":\"${GITHUB_REPOSITORY}\",\"author\":\"${GITHUB_ACTOR}\"}" |
| 40 | + ) |
18 | 41 | echo "Received $CODE" |
19 | 42 | if [[ "$CODE" == "200" ]]; then |
20 | 43 | echo "✅ Commit is verified" |
|
0 commit comments