From cbd04a704dc580b99a6b1191691354fa322365f2 Mon Sep 17 00:00:00 2001 From: GummersGG <84169165+GummersGG@users.noreply.github.com> Date: Tue, 4 Apr 2023 12:00:09 -0500 Subject: [PATCH] Create dispatch-on-release.yml Dispatches version release notes to technical documents (changelog.md) --- .github/workflows/dispatch-on-release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/dispatch-on-release.yml diff --git a/.github/workflows/dispatch-on-release.yml b/.github/workflows/dispatch-on-release.yml new file mode 100644 index 0000000..9fa37ae --- /dev/null +++ b/.github/workflows/dispatch-on-release.yml @@ -0,0 +1,23 @@ +# Dispatches version release notes to technical documents (changelog.md) + +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"