Closed gabiganam closed 2 years ago
Hey @gabiganam,
Could you please share your action configuration so that I can have a better look and suggest something?
Of course @ravgeetdhillon :)
This action for example, is a simple action that deletes a k8s namespace when a branch is deleted:
name: Delete namespace on branch deletion
on: delete
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
delete:
if: github.event.ref_type == 'branch'
env:
REF: refs/heads/${{ github.event.ref }}
runs-on: ubuntu-latest
steps:
- name: Slack notification
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
notification_title: '1/2 - Deleting namespace...'
message_format: ''
footer: '<{run_url}|See Action Run> | <{repo_url}|Repo {repo}> | <{workflow_url}|{workflow} Workflow>'
<several steps redacted here>
- name: Slack notification
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
notification_title: '2/2 - Namespace deleted!'
message_format: ''
footer: '<{run_url}|See Action Run> | <{repo_url}|Repo {repo}> | <{workflow_url}|{workflow} Workflow>'
BTW can you please take a look at this too? https://github.com/ravsamhq/notify-slack-action/issues/39 In this context for example, I have an environment variable called "namespace" that I would love to print in the Slack notification title!
Thank you for both fixes!
I noticed that if I cancel a running action, I don't get any Slack notification about it. I'm using
if: always()
on all of my notifications. Am I missing something? or is this not supported?