File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments