Browse Source

handle action body json parse error

push-params v0.10.7
Evan Feenstra 4 years ago
parent
commit
d87686a2f3
  1. 2
      .github/workflows/release.yml
  2. 10
      .github/workflows/update.yml
  3. 1
      api/controllers/actions.ts
  4. 1
      dist/api/controllers/actions.js
  5. 2
      dist/api/controllers/actions.js.map

2
.github/workflows/release.yml

@ -14,7 +14,7 @@ jobs:
- name: Git tag
run: echo "::set-env name=HEAD_TAG::$(git tag --points-at HEAD)"
- name: Webhook
uses: joelwmale/webhook-action@master
uses: joelwmale/webhook-action@749e2dcbc6735ce0c36e1dbbb660618cd7b5f91c
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
data: "{'text': '[GITHUB] New release in sphinx-relay! ${{ env.HEAD_TAG }}', 'action': 'broadcast', 'app': 'github', 'secret': '${{ secrets.WEBHOOK_SECRET }}', 'chat_uuid': 'XzsnzB-numfWNUcTXGkEkoMKCt4k36C2t60a-zohJTWrL--vHjia2WQ11gwbwdAtnsYTT3fyzRhH2YF7KqiOxwnGVlkd'}"

10
.github/workflows/update.yml

@ -9,8 +9,14 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Check out from Git
uses: actions/checkout@v2
- name: Git tag
run: echo "::set-env name=COMMIT_MSG::$(git log -1 --pretty=format:%B)"
- name: Commit Author
run: echo "::set-env name=COMMIT_AUTHOR::$(git log -1 --pretty=format:'%an')"
- name: Webhook
uses: joelwmale/webhook-action@master
uses: joelwmale/webhook-action@749e2dcbc6735ce0c36e1dbbb660618cd7b5f91c
env:
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
data: "{'text': '[GITHUB] New push in sphinx-relay master', 'action': 'broadcast', 'app': 'github', 'secret': '${{ secrets.WEBHOOK_SECRET }}', 'chat_uuid': 'XzsnzB-numfWNUcTXGkEkoMKCt4k36C2t60a-zohJTWrL--vHjia2WQ11gwbwdAtnsYTT3fyzRhH2YF7KqiOxwnGVlkd'}"
data: "{'text': 'New push in sphinx-relay by ${{ env.COMMIT_AUTHOR }}: ${{ env.COMMIT_MSG }}', 'action': 'broadcast', 'app': 'github', 'secret': '${{ secrets.WEBHOOK_SECRET }}', 'chat_uuid': 'XzsnzB-numfWNUcTXGkEkoMKCt4k36C2t60a-zohJTWrL--vHjia2WQ11gwbwdAtnsYTT3fyzRhH2YF7KqiOxwnGVlkd'}"

1
api/controllers/actions.ts

@ -39,6 +39,7 @@ async function processExtra(req, res) {
if(dataBody) body=dataBody
} catch(e) {
console.log(e)
return failure(res, 'failed to parse webhook body json')
}
}
const {action,app,secret,pubkey,amount,chat_uuid,text} = body

1
dist/api/controllers/actions.js

@ -54,6 +54,7 @@ function processExtra(req, res) {
}
catch (e) {
console.log(e);
return res_1.failure(res, 'failed to parse webhook body json');
}
}
const { action, app, secret, pubkey, amount, chat_uuid, text } = body;

2
dist/api/controllers/actions.js.map

@ -1 +1 @@
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../api/controllers/actions.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA+C;AAC/C,6BAA4B;AAC5B,yBAAwB;AACxB,sCAAqC;AACrC,sCAAkC;AAClC,oCAAmC;AACnC,qCAAoC;AAEpC;;EAEE;AAEF,MAAM,UAAU,GAAG,uBAAuB,CAAA;AAC1C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,UAAU,CAAC,CAAA;QAC/C,IAAI;YACA,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBACxB,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;aACzB;iBAAM;gBACH,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;aAC1B;SACJ;QAAC,OAAM,GAAG,EAAE;YACT,OAAO,CAAC,KAAK,CAAC,G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