File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,14 @@ jobs:
1313
1414 steps :
1515 - name : Extract event details
16- run : |
17- echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
16+ run : echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
1817
19- - name : Call External API
18+ - name : Call External API (with HMAC signature)
19+ env :
20+ WEBHOOK_SECRET : ${{ secrets.WEBHOOK_SECRET }}
2021 run : |
21- curl -X POST https://firstly-worthy-chamois.ngrok-free.app/github-webhook \
22+ SIGNATURE=$(echo -n "$EVENT_PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | cut -d " " -f2)
23+ curl -X POST https://your-webhook-url/github-webhook \
2224 -H "Content-Type: application/json" \
25+ -H "X-Hub-Signature-256: sha256=$SIGNATURE" \
2326 -d "$EVENT_PAYLOAD"
You can’t perform that action at this time.
0 commit comments