From 7842ded2d08777cdf2ea8cb25ad90f161e102db9 Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Thu, 27 Jul 2023 14:45:24 +0900 Subject: [PATCH] updated community notify script --- .github/workflows/community-notify.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/community-notify.yml b/.github/workflows/community-notify.yml index 837f28c13..0cfb2001c 100644 --- a/.github/workflows/community-notify.yml +++ b/.github/workflows/community-notify.yml @@ -8,14 +8,14 @@ jobs: send-notify: runs-on: ubuntu-latest steps: - - name: Install Dependencies - run: | - sudo apt-get -y update - sudo apt-get -y install jq curl - env: - DEBIAN_FRONTEND: 'noninteractive' + - name: Manipulate Event + uses: actions/github-script@v6 + id: set-result + with: + script: | + const fs = require('fs'); + const payload = { ...context.payload, action: 'created' }; + fs.writeFileSync(process.env.GITHUB_EVENT_PATH, JSON.stringify(payload)); - name: Post Event run: | - curl -X POST -H 'Content-Type: application/json' \ - -d $(echo '${{ toJSON(github.event) }}' | jq '.action = "created"') \ - ${{ secrets.DISCORD_NOTIFY_WEBHOOK }} \ No newline at end of file + curl -X POST -H 'Content-Type: application/json' -d @$GITHUB_EVENT_PATH ${{ secrets.DISCORD_NOTIFY_WEBHOOK }} \ No newline at end of file