{"id":25491526,"url":"https://github.com/reasonsoftware/action-notify-slack","last_synced_at":"2025-04-10T00:06:22.919Z","repository":{"id":40366874,"uuid":"338788620","full_name":"ReasonSoftware/action-notify-slack","owner":"ReasonSoftware","description":":octocat: A GitHub Action for sending notifications as Slack Attachments","archived":false,"fork":false,"pushed_at":"2023-10-01T04:30:08.000Z","size":1158,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T00:06:16.837Z","etag":null,"topics":["action","cd","ci","devops","github","notification","notify","report","slack","status"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReasonSoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-14T11:21:49.000Z","updated_at":"2022-01-01T21:15:11.000Z","dependencies_parsed_at":"2024-06-19T22:51:45.222Z","dependency_job_id":"81edbd4e-caaf-4cac-88f9-9e7a6260bc6e","html_url":"https://github.com/ReasonSoftware/action-notify-slack","commit_stats":{"total_commits":30,"total_committers":5,"mean_commits":6.0,"dds":0.3666666666666667,"last_synced_commit":"2f81ec2375fdea289759ddcd620dfbf1f25fe671"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReasonSoftware%2Faction-notify-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReasonSoftware%2Faction-notify-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReasonSoftware%2Faction-notify-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReasonSoftware%2Faction-notify-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReasonSoftware","download_url":"https://codeload.github.com/ReasonSoftware/action-notify-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131319,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","cd","ci","devops","github","notification","notify","report","slack","status"],"created_at":"2025-02-18T22:17:52.623Z","updated_at":"2025-04-10T00:06:22.897Z","avatar_url":"https://github.com/ReasonSoftware.png","language":"Go","readme":"# action-notify-slack\n\n[![Release](https://img.shields.io/github/v/release/ReasonSoftware/action-notify-slack)](https://github.com/ReasonSoftware/action-notify-slack/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ReasonSoftware/action-notify-slack)](https://goreportcard.com/report/github.com/ReasonSoftware/action-notify-slack)\n[![Docker Pulls](https://img.shields.io/docker/pulls/reasonsoftware/action-notify-slack)](https://hub.docker.com/r/reasonsoftware/action-notify-slack)\n[![License](https://img.shields.io/github/license/ReasonSoftware/action-notify-slack)](LICENSE.md)\n\nA **GitHub Action** for sending notifications as Slack Attachments\n\n![PIC](docs/images/demo.gif)\n\n## Features\n\n- Easily notify using a default template\n- Replace default template with your own\n- Add more fields on top of default/custom template\n- Update previously sent messages\n- Update single notification across multiple jobs in a workflow\n- Send multiple Attachments\n- Incredibly fast! About 2MB docker image\n\n## Manual\n\n1. Create a [Secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)  containing a **Slack Token** ([manual](docs/SLACK.md#slack-token)).\n2. Create a [Secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)  containing a **Slack Channel ID** ([manual](docs/SLACK.md#slack-channel)).\n3. Add **action-notify-slack** to your workflow:\n\n```yaml\n    - name: Notification\n      uses: docker://reasonsoftware/action-notify-slack:v1\n      env:\n        TOKEN: ${{ secrets.SLACK_TOKEN }}\n        CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n        STATUS: started\n```\n\n## Configuration\n\nConfigure this action via environmental variables:\n\n- **Required settings**:\n  - `TOKEN`: [Slack Token](docs/SLACK.md#slack-token)\n  - `CHANNEL`: [Slack Channel](docs/SLACK.md#slack-channel)\n- **Optional settings**:\n  - `STATUS`: defines a color of an attachment and text under **Status** field. Choose one of the following:\n    - `running/started/building/initializing`: Yellow :yellow_square:\n    - `deploying/uploading/publishing/creating`: Orange :orange_square:\n    - `finished/succeeded/passed/built/released`: Green :green_square:\n    - `failed/aborted/canceled/terminated`: Red :red_square:\n    - **Anything Else**: Gray :white_large_square:\n  - `TIMESTAMP`: update previously sent message by providing an output of a previous step\n  - `ATTACHMENTS_FILE`: provide a path to JSON file containing a valid **Slack Attachment** to override a message template with your own (`STATUS` and `SEPARATOR` will be ignored)\n  - `SEPARATOR`: argument separator for additional fields (default `==`)\n  - `TIMESTAMP_FILE`: a path to a file (directory and file will be created if not exist) which will contain a timestamp. Used as a *buffer* on complex flows that constantly update the same message (*If used in multi-job workflow, you will have to collect that file as an artifact and extract it in another job*)\n  - `FAIL`: failure trap which will tweak the message to be **failed** on value `\"true\"`. Useful in a mid flow notification with parameter: `FAIL: \"${{ failure() }}\"` (enables to send a `finished` or `failed` message in a single step)\n\n### Examples\n\n\u003cdetails\u003e\u003csummary\u003e:information_source: Additional Fields\u003c/summary\u003e\n\nYou may add additional fields to a default message template via arguments\n\n- Default separator `==` may be changed by setting an environmental variable `SEPARATOR` with a custom value\n- Arguments are expected to be divided by new line `\\n`\n- Field Name or Values should be enclosed in `\"` if they contain whitespace\n\n```yaml\n    - name: Notification\n      uses: docker://reasonsoftware/action-notify-slack:v1\n      env:\n        TOKEN: ${{ secrets.SLACK_TOKEN }}\n        CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n        STATUS: finished\n      with:\n        args: |\n          \"Download URL\"==\u003chttps://my-website.com/file.exe|file\u003e\n          Version==v3.1.0\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e:information_source: Custom Message\u003c/summary\u003e\n\nCreate a JSON file with Slack attachments and provide a path as an environmental variable. For instance:\n\n- Use another action to create attachments with your information dynamically\n- Use a **shell** to create attachments dynamically\n- Store it somewhere and fetch the file during the execution with `curl` or `wget`\n- Commit a base skeleton to the repository and modify it in a dedicated step\n\n```yaml\n    - name: Notify Slack\n      uses: docker://reasonsoftware/action-notify-slack:v1\n      env:\n        TOKEN: ${{ secrets.SLACK_TOKEN }}\n        CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n        ATTACHMENTS_FILE: attachments.json\n```\n\n#### :warning: Remarks\n\n- Provide either a single attachment (`{}`) or a list of attachments (`[]`) in a single JSON file\n- Design your message [here](https://api.slack.com/docs/messages/builder?msg=%7B%22attachments%22%3A%5B%7B%22fallback%22%3A%22Required%20plain-text%20summary%20of%20the%20attachment.%22%2C%22color%22%3A%22%2336a64f%22%2C%22pretext%22%3A%22Optional%20text%20that%20appears%20above%20the%20attachment%20block%22%2C%22author_name%22%3A%22Bobby%20Tables%22%2C%22author_link%22%3A%22http%3A%2F%2Fflickr.com%2Fbobby%2F%22%2C%22author_icon%22%3A%22http%3A%2F%2Fflickr.com%2Ficons%2Fbobby.jpg%22%2C%22title%22%3A%22Slack%20API%20Documentation%22%2C%22title_link%22%3A%22https%3A%2F%2Fapi.slack.com%2F%22%2C%22text%22%3A%22Optional%20text%20that%20appears%20within%20the%20attachment%22%2C%22fields%22%3A%5B%7B%22title%22%3A%22Priority%22%2C%22value%22%3A%22High%22%2C%22short%22%3Afalse%7D%5D%2C%22image_url%22%3A%22http%3A%2F%2Fmy-website.com%2Fpath%2Fto%2Fimage.jpg%22%2C%22thumb_url%22%3A%22http%3A%2F%2Fexample.com%2Fpath%2Fto%2Fthumb.png%22%2C%22footer%22%3A%22Slack%20API%22%2C%22footer_icon%22%3A%22https%3A%2F%2Fplatform.slack-edge.com%2Fimg%2Fdefault_application_icon.png%22%2C%22ts%22%3A123456789%7D%5D%7D)\n- Remember to provide only the **attachments** and not a whole message\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e:information_source: Update Message\u003c/summary\u003e\n\n- Add an `id` field to a first notification in a workflow\n- Reference `outputs.timestamp` of previously set `id` as a `TIMESTAMP` env.var in the next notification\n  - You may chain more notification steps using the same technique. Just keep adding `id`'s :wink:\n\n```yaml\n    - name: Notify\n      id: notify\n      uses: docker://reasonsoftware/action-notify-slack:v1\n      env:\n        TOKEN: ${{ secrets.SLACK_TOKEN }}\n        CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n        START: building\n\n    - name: Update Notification\n      uses: docker://reasonsoftware/action-notify-slack:v1\n      env:\n        TOKEN: ${{ secrets.SLACK_TOKEN }}\n        CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n        STATUS: released\n        TIMESTAMP: ${{steps.notify.outputs.timestamp}}\n      with:\n        args: |\n          Download==\u003chttps://my-website.com/file.exe|file\u003e\n          Version==v3.1.0\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eTimestamp File Buffer\u003c/summary\u003e\n\n- Add an `id` to your first notification in a workflow\n- Reference `outputs.timestamp` of previously set `id` as a `TIMESTAMP` env.var in the next notification\n  - You may chain more notification steps using the same technique. Just keep adding `id`'s :wink:\n\n```yaml\njobs:\n  ci:\n    name: build\n    runs-on: ubuntu-latest\n    steps:\n      - name: Notification\n        uses: docker://reasonsoftware/action-notify-slack:v1\n        env:\n          TOKEN: ${{ secrets.SLACK_TOKEN }}\n          CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n          STATUS: started\n          TIMESTAMP_FILE: .github/notify.ts\n\n      - name: Checkout\n        uses: actions/checkout@v2\n      \n      - name: Build\n        run: docker build --tag=org/proj:tag .\n      \n      - name: Notification\n        uses: docker://reasonsoftware/action-notify-slack:v1\n        env:\n          TOKEN: ${{ secrets.SLACK_TOKEN }}\n          CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n          STATUS: publishing\n          TIMESTAMP_FILE: .github/notify.ts\n      \n      - name: Push\n        run: docker push org/proj:tag\n\n      - uses: actions/upload-artifact@v2\n        with:\n          name: timestamp\n          path: .github/notify.ts\n\n      - name: Notification\n        if: ${{ failure() }}\n        uses: docker://reasonsoftware/action-notify-slack:v1\n        env:\n          TOKEN: ${{ secrets.SLACK_TOKEN }}\n          CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n          STATUS: failed\n          TIMESTAMP_FILE: .github/notify.ts\n\n  cd:\n    name: deploy\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/download-artifact@v2\n        with:\n          name: timestamp\n          path: .github/notify.ts\n\n      - name: Notification\n        uses: docker://reasonsoftware/action-notify-slack:v1\n        env:\n          TOKEN: ${{ secrets.SLACK_TOKEN }}\n          CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n          STATUS: deploying\n          TIMESTAMP_FILE: .github/notify.ts\n      \n      - name: Deploy\n        run: helm upgrade --install application repository/application\n      \n      - name: Notification\n        uses: docker://reasonsoftware/action-notify-slack:v1\n        env:\n          TOKEN: ${{ secrets.SLACK_TOKEN }}\n          CHANNEL: ${{ secrets.SLACK_CHANNEL }}\n          STATUS: finished\n          FAIL: ${{ failure() }}\n          TIMESTAMP_FILE: .github/notify.ts\n```\n\n\u003c/details\u003e\n\n## Notes\n\n- This action is automatically built at [**Docker Hub**](https://hub.docker.com/r/reasonsoftware/action-notify-slack), and tagged with `latest / v1 / v1.2 / v1.2.3` allowing to lock against a certain version\n*It's recommended to lock against a major version, for example* `v1`\n- Docker image is published both to [**Docker Hub**](https://hub.docker.com/r/reasonsoftware/action-notify-slack) and [**GitHub Packages**](https://github.com/ReasonSoftware/action-notify-slack/packages). If you don't want to rely on **Docker Hub** but still want to use the dockerized action, you may switch from `uses: docker://reasonsoftware/action-notify-slack:v1` to `uses: docker://docker.pkg.github.com/reasonsoftware/action-notify-slack/action-notify-slack:v1`\n\n## License\n\n[Apache-2.0](LICENSE.md) © 2021 [Reason Cybersecurity Ltd.](https://www.reasonsecurity.com/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freasonsoftware%2Faction-notify-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freasonsoftware%2Faction-notify-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freasonsoftware%2Faction-notify-slack/lists"}