We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6bc7e19 commit 5f40444Copy full SHA for 5f40444
.github/workflows/python-app.yml
@@ -13,11 +13,14 @@ jobs:
13
14
steps:
15
- name: Extract event details
16
- run: |
17
- echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
+ run: echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
18
19
- - name: Call External API
+ - name: Call External API (with HMAC signature)
+ env:
20
+ WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
21
run: |
- 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 \
24
-H "Content-Type: application/json" \
25
+ -H "X-Hub-Signature-256: sha256=$SIGNATURE" \
26
-d "$EVENT_PAYLOAD"
0 commit comments