Releases: rohammosalli/slack-action
Releases · rohammosalli/slack-action
add branch sensitive
also added branch sensitive
check message conditions (successful or failed)
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
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'.