Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed alert msg to be sent to a slack webhook. #1929

Merged

Commits on Mar 19, 2024

  1. Changed alert msg to be sent to a slack webhook.

    Created an action that sends a customizable message along with some
    static information related to the workflow's job it was running.
    
    It's currently used in conjunction with if: ${{ failure() }} to
    send a message to configured webhook as an alert for a failing job, but
    can be reused for any other purpose, as long as the webhook endpoint
    accepts the json object that will be sent to.
    
    The webhook is free to format the final message accordingly but these are
    the fields it will receive:
    {
      "attempt": "1",
      "message": "Alert or custom message!",
      "job_url": "https:/github.com/path/to/workflow/job",
      "commit_url": "https://github.com/path/to/commit",
      "repo_url": "https://github.com/path/to/repo"
    }
    
    Where job_url, commit_url and attempt point to the job where the
    workflow is/was running, the commit_url of the commit that triggered the
    workflow and the job attempt number respectively.
    
    Only the message is customizable by means of the step's "with.message"
    field. The other fields are internally set by the action.
    
    The webhook URL should be stored in a secret and passed to the
    "with.slack_webook" field of the step.
    greyerof committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    8ff395d View commit details
    Browse the repository at this point in the history