Skip to content

innocarpe/actions-slack

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

actions-slack

GitHub Actions status GitHub Actions status

You can notify to Slack in GitHub Actions workflow.

Screen Shot 2019-12-19 at 1 06 23 AM

Usage

Simple case

steps:
  - name: Action 1
    uses: ...

  - name: Action 2
    run: ...

  - name: Notify
    uses: innocarpe/actions-slack@v1
    with:
      status: ${{ jobs.<job_id>.status }} # Required
      success_text: 'Step Succeeded 🚀' # Optional
      failure_text: 'Step Failed 😱' # Optional
      cancelled_text: 'Step Cancelled ⚠️' # Optional
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # Required

Advanced case

You can use slack group mention(@your-group) and github actor/ref and so on.

steps:
  - name: Notify the start
    uses: innocarpe/actions-slack@v1
    with:
      status: ${{ jobs.<job_id>.status }} # Required
      success_text: '<!subteam^S1ABC2DEF> @${{ github.actor }} just started the workflow for `${{ github.ref }}`'
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # Required

  - name: Action 1
    uses: ...

  - name: Action 2
    run: ...
    
  - name: Notify to Slack
    uses: innocarpe/actions-slack@v1
    with:
      status: ${{ jobs.<job_id>.status }} # Required
      success_text: '<!subteam^S1ABC2DEF> The awesome workflow just finished ✅'
      failure_text: '<!subteam^S1ABC2DEF> The bad workflow failed. Please check the issue below 👇'
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # Required

About

Slack notifications for GitHub Actions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •