Skip to content

Commit

Permalink
[workspace] fix release automation - use personal access token, log s…
Browse files Browse the repository at this point in the history
…lack api failures (#3905)

This PR makes the following changes:
- Update `publish-master.yml` workflow to use the github Terascope
Release App with `actions/create-github-app-token@v1` to create an
access token. The previous token used cannot trigger a secondary
workflow.
- Log slack API failures for debugging purposes.
  • Loading branch information
busma13 authored Jan 14, 2025
1 parent b36fe30 commit 45e6ccc
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/publish-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,41 @@ jobs:
echo "version_updated=false" >> $GITHUB_OUTPUT
fi
- name: Generate a token
if: steps.version_check.outputs.version_updated == 'true'
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.RELEASES_APP_ID }}
private-key: ${{ secrets.RELEASES_PRIVATE_KEY }}

- name: Create Release
if: steps.version_check.outputs.version_updated == 'true'
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.generate-token.outputs.token }}
prerelease: true
tag_name: ${{ steps.version_check.outputs.tag }}
name: ${{ steps.version_check.outputs.tag }}
generate_release_notes: true

- name: Announce release in Slack releases channel
if: steps.version_check.outputs.version_updated == 'true'
id: announce-release
uses: slackapi/[email protected]
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ vars.SLACK_RELEASES_CHANNEL_ID }}
text: |
"Teraslice version ${{ steps.version_check.outputs.tag }} has been released.
Teraslice version ${{ steps.version_check.outputs.tag }} has been released.
Please review and revise the automated release notes:
https://github.com/terascope/teraslice/releases/tag/${{ steps.version_check.outputs.tag }}"
https://github.com/terascope/teraslice/releases/tag/${{ steps.version_check.outputs.tag }}
- name: Failed Announcement Response
if: ${{ steps.announce-release.outputs.ok == 'false' }}
run: echo "Slackbot API failure response - ${{ steps.announce-release.outputs.response }}"

build-docs:
if: github.event.pull_request.merged == true
Expand Down

0 comments on commit 45e6ccc

Please sign in to comment.