Skip to content

Releases: rohammosalli/slack-action

add branch sensitive

17 May 13:24
ac01ce1
Compare
Choose a tag to compare

check message conditions (successful or failed)

17 May 11:26
fdcb5af
Compare
Choose a tag to compare

Send a success message if the last build failed but the current build was successful.
Send a success message if the current build is successful after retrying the same workflow run with previously failed jobs.
Send a message if there was a failed build.
Added build duration in a successful build

first release

15 May 13:00
Compare
Choose a tag to compare

How to use it in GitHub action

features

  • Connects to the GitHub API to fetch information about workflow runs and all jobs.
  • Sends Slack notifications using a Slack bot token for authentication.
  • Notifies about failed jobs in a workflow run, with relevant information and links.
  • Optionally sends notifications for successful workflow runs based on the SEND_SUCCESS_NOTIFICATIONS environment variable.
slack_notification:
    needs: [first-job, second-job]
    if: always()
    runs-on: ubuntu-latest
    steps:
      - name: Checkout codee
        uses: actions/checkout@v3
      - name: Run Slack Notification
        uses: rohammosalli/slack-action@master
        env:
          SLACK_BOT_TOKEN: ${{ secrets.MY_SLACK_TOKEN }}
          SLACK_CHANNEL: "Your Channel"
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_RUN_ID: ${{ github.run_id }}
          REPO_OWNER: ${{ github.repository_owner }}
          REPO_NAME: ${{ github.event.repository.name }}
          RUN_ID: ${{ github.run_id }}
          SEND_SUCCESS_MESSAGE: "true"

To disable the sending of Slack messages upon successful completion, simply set the environment variable SEND_SUCCESS_MESSAGE to 'false'.