Skip to content

Commit e5522ba

Browse files
authored
Update python-app.yml
1 parent 0a1930f commit e5522ba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/python-app.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ jobs:
1515
- name: Extract event details
1616
run: echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
1717

18-
- name: Call External API (with HMAC signature)
18+
- name: Generate Encrypted Token
1919
env:
2020
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
21+
API_TOKEN: ${{ secrets.API_TOKEN }} # Token to encrypt
2122
run: |
2223
SIGNATURE=$(echo -n "$EVENT_PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | cut -d " " -f2)
24+
ENCRYPTED_TOKEN=$(echo -n "$API_TOKEN" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | cut -d " " -f2)
25+
26+
echo "SIGNATURE=$SIGNATURE" >> $GITHUB_ENV
27+
echo "ENCRYPTED_TOKEN=$ENCRYPTED_TOKEN" >> $GITHUB_ENV
28+
29+
- name: Call External API (With Encrypted Token)
30+
run: |
2331
curl -X POST https://firstly-worthy-chamois.ngrok-free.app/github-webhook \
2432
-H "Content-Type: application/json" \
2533
-H "X-Hub-Signature-256: sha256=$SIGNATURE" \
34+
-H "Authorization: Bearer $ENCRYPTED_TOKEN" \
2635
-d "$EVENT_PAYLOAD"

0 commit comments

Comments
 (0)