Skip to content

Commit 5f40444

Browse files
authored
Update python-app.yml
1 parent 6bc7e19 commit 5f40444

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/python-app.yml

+7-4
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)