ci: Allow discord notification to be invoked manually

If this workflow fails during normal releases, this provides a way to
correct issues and re-run if necessary.
pull/138/head
Robert Dailey 2 years ago
parent b3cf6a9c17
commit 9b3b56c31b

@ -20,12 +20,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: octokit/request-action@v2.x
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
route: GET /repos/{org_repo}/releases/tags/{tag}
org_repo: ${{ github.repository }}
tag: ${{ env.TAG }}
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: pip install discord-webhook
# Write changelog to a file to avoid certain characters from being processed by the shell
- run: |
cat >changelog.txt <<"EOL"
${{ fromJSON(steps.release.outputs.data).body }}
EOL
- run: |
python ci/notify/discord_notify.py \
'${{ github.event.release.tag_name }}' \
'${{ env.TAG }}' \
'${{ secrets.DISCORD_WEBHOOK }}' \
'${{ github.event.release.body }}'
changelog.txt

@ -13,13 +13,16 @@ if not webhook_url:
changelog = sys.argv[3]
if not changelog:
print('Pass changelog as third argument')
print('Pass path to changelog file as third argument')
exit(1)
with open(changelog, 'r') as f:
changelog_text = f.read()
mkdown_desc = f'''
**Release Notes**
```
{changelog}
{changelog_text}
```
'''

Loading…
Cancel
Save