File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,21 @@ jobs:
15
15
- name : Extract event details
16
16
run : echo "EVENT_PAYLOAD=$(jq -c . < $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
17
17
18
- - name : Call External API (with HMAC signature)
18
+ - name : Generate Encrypted Token
19
19
env :
20
20
WEBHOOK_SECRET : ${{ secrets.WEBHOOK_SECRET }}
21
+ API_TOKEN : ${{ secrets.API_TOKEN }} # Token to encrypt
21
22
run : |
22
23
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 : |
23
31
curl -X POST https://firstly-worthy-chamois.ngrok-free.app/github-webhook \
24
32
-H "Content-Type: application/json" \
25
33
-H "X-Hub-Signature-256: sha256=$SIGNATURE" \
34
+ -H "Authorization: Bearer $ENCRYPTED_TOKEN" \
26
35
-d "$EVENT_PAYLOAD"
You can’t perform that action at this time.
0 commit comments