Skip to content

Fetch Latest Release Notes #23

Fetch Latest Release Notes

Fetch Latest Release Notes #23

Workflow file for this run

name: Fetch Latest Release Notes
on: workflow_dispatch
jobs:
fetch_release_notes:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Get latest release notes
id: fetch_release_notes
run: |
RELEASE=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
RELEASE_NOTES=$(echo "$RELEASE" | jq -r '.body')
TAG_NAME=$(echo "$RELEASE" | jq -r '.tag_name')
printf "RELEASE_NOTES<<EOF\n%s\nEOF\n" "$RELEASE_NOTES" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Output release notes
run: |
echo "Latest Release Notes:"
echo "${{ env.RELEASE_NOTES }}"
- name: Notify Slack about latest release
run: |
SLACK_MESSAGE="*New release: ${{ env.TAG_NAME }}*\n${{ env.RELEASE_NOTES }}"
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "'"$SLACK_MESSAGE"'"}' \
${{ secrets.SLACK_WEBHOOK_URL }}