Skip to content

Commit

Permalink
Merge pull request #276 from catalyst-cooperative/release-notify
Browse files Browse the repository at this point in the history
Notify Slack on new release.
  • Loading branch information
zaneselvans authored Sep 16, 2023
2 parents 32396b6 + edc17ea commit 646c052
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
path: dist/

pypi-publish:
name: Upload release to Test PyPI
name: Upload release to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- build
Expand Down Expand Up @@ -72,3 +72,29 @@ jobs:
gh release create '${{ github.ref_name }}' ./dist/*.tar.gz ./dist/*.whl
--generate-notes
--repo '${{ github.repository }}'
release-notify:
runs-on: ubuntu-latest
needs:
- github-publish
if: ${{ always() }}
steps:
- name: Inform the Codemonkeys
uses: 8398a7/action-slack@v3
continue-on-error: true
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
username: 'action-slack',
icon_emoji: ':octocat:',
attachments: [{
color: '${{ needs.github-publish.result }}' === 'success' ? 'good' : '${{ needs.github-publish.result }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_REPO}@${process.env.AS_REF}\n ${process.env.AS_WORKFLOW} (${process.env.AS_COMMIT})\n by ${process.env.AS_AUTHOR}\n Status: ${{ needs.github-publish.result }}`,
}]
}
env:
GITHUB_TOKEN: ${{ github.token }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
MATRIX_CONTEXT: ${{ toJson(matrix) }} # required

0 comments on commit 646c052

Please sign in to comment.