From abf1defce3faf3c345af02581ed3192608966c0c Mon Sep 17 00:00:00 2001 From: GummersGG <84169165+GummersGG@users.noreply.github.com> Date: Tue, 4 Apr 2023 11:47:09 -0500 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5023138 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Dispatch on Release + +on: + release: + types: [published] + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Install jq + run: sudo apt-get install jq + + - name: Send repository_dispatch event + run: | + body=$(echo "${{ github.event.release.body }}" | jq -R -s -r '@json') + curl -X POST \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" \ + --data "{\"event_type\": \"new-release\", \"client_payload\": {\"tag_name\": \"${{ github.event.release.tag_name }}\", \"html_url\": \"${{ github.event.release.html_url }}\", \"body\": $body, \"published_at\": \"${{ github.event.release.published_at }}\", \"sender_login\": \"${{ github.event.sender.login }}\", \"release_url\": \"${{ github.event.release.url }}\"} }" \ + "https://api.github.com/repos/GummersGG/test-things/dispatches"