Skip to content

Commit

Permalink
Create dispatch-on-release.yml
Browse files Browse the repository at this point in the history
Dispatches version release notes to technical documents (changelog.md)
  • Loading branch information
GummersGG authored Apr 4, 2023
1 parent fe48db3 commit cbd04a7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dispatch-on-release.yml
Original file line number Diff line number Diff line change
@@ -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"

1 comment on commit cbd04a7

@GummersGG
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.