{"id":13582351,"url":"https://github.com/arbourd/concourse-slack-alert-resource","last_synced_at":"2025-04-05T23:11:29.530Z","repository":{"id":41137151,"uuid":"133834771","full_name":"arbourd/concourse-slack-alert-resource","owner":"arbourd","description":"A structured Slack notification resource for Concourse","archived":false,"fork":false,"pushed_at":"2025-03-06T16:45:43.000Z","size":778,"stargazers_count":38,"open_issues_count":3,"forks_count":24,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T22:09:36.480Z","etag":null,"topics":["concourse","resource","slack"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/arbourd/concourse-slack-alert-resource/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arbourd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-05-17T15:40:25.000Z","updated_at":"2025-03-06T16:45:46.000Z","dependencies_parsed_at":"2024-01-09T18:44:58.819Z","dependency_job_id":"3c5af1a7-bdc6-490e-af97-65350eae1ef7","html_url":"https://github.com/arbourd/concourse-slack-alert-resource","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbourd%2Fconcourse-slack-alert-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbourd%2Fconcourse-slack-alert-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbourd%2Fconcourse-slack-alert-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbourd%2Fconcourse-slack-alert-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arbourd","download_url":"https://codeload.github.com/arbourd/concourse-slack-alert-resource/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411237,"owners_count":20934653,"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":["concourse","resource","slack"],"created_at":"2024-08-01T15:02:37.641Z","updated_at":"2025-04-05T23:11:29.511Z","avatar_url":"https://github.com/arbourd.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/arbourd/concourse-slack-alert-resource)](https://goreportcard.com/report/github.com/arbourd/concourse-slack-alert-resource)\n\n# concourse-slack-alert-resource\n\nA structured and opinionated Slack notification resource for [Concourse](https://concourse-ci.org/).\n\n\u003cimg src=\"./img/default.png\" width=\"60%\"\u003e\n\nThe message is built by using Concourse's [resource metadata](https://concourse-ci.org/implementing-resource-types.html#resource-metadata) to show the pipeline, job, build number and a URL.\n\n## Installing\n\nUse this resource by adding the following to the resource_types section of a pipeline config:\n\n```yaml\nresource_types:\n\n- name: slack-alert\n  type: registry-image\n  source:\n    repository: ghcr.io/arbourd/concourse-slack-alert-resource\n```\n\nSee the [Concourse docs](https://concourse-ci.org/resource-types.html) for more details on adding `resource_types` to a pipeline config.\n\n## Source Configuration\n\n* `url`: *Required.* Slack webhook URL.\n* `channel`: *Optional*. Target channel where messages are posted. If unset the default channel of the webhook is used.\n* `concourse_url`: *Optional.* The external URL that points to Concourse. Defaults to the env variable `ATC_EXTERNAL_URL`.\n* `username`: *Optional.* Concourse local user (or basic auth) username. Required for non-public pipelines if using alert type `fixed` or `broke`\n* `password`: *Optional.* Concourse local user (or basic auth) password. Required for non-public pipelines if using alert type `fixed` or `broke`\n* `disable`: *Optional.* Disables the resource (does not send notifications). Defaults to `false`.\n\n## Behavior\n\n### `check`: No operation.\n\n### `in`: No operation.\n\n### `out`: Send a message to Slack.\n\nSends a structured message to Slack based on the alert type.\n\n#### Parameters\n\n- `alert_type`: *Optional.* The type of alert to send to Slack. See [Alert Types](#alert-types). Defaults to `default`.\n- `channel`: *Optional.* Channel where this message is posted. Defaults to the `channel` setting in Source.\n- `channel_file`: *Optional.* File containing text which overrides `channel`. If the file cannot be read, `channel` will be used instead.\n- `message`: *Optional.* The status message at the top of the alert. Defaults to name of alert type.\n- `message_file`: *Optional.* File containing text which overrides `message`. If the file cannot be read, `message` will be used instead.\n- `text`: *Optional.* Additional text below the message of the alert. Defaults to an empty string.\n- `text_file`: *Optional.* File containing text which overrides `text`. If the file cannot be read, `text` will be used instead.\n- `color`: *Optional.* The color of the notification bar as a hexadecimal. Defaults to the icon color of the alert type.\n- `disable`: *Optional.* Disables the alert. Defaults to `false`.\n\n#### Alert Types\n\n- `default`\n\n  \u003cimg src=\"./img/default.png\" width=\"50%\"\u003e\n\n- `success`\n\n  \u003cimg src=\"./img/success.png\" width=\"50%\"\u003e\n\n- `failed`\n\n  \u003cimg src=\"./img/failed.png\" width=\"50%\"\u003e\n\n- `started`\n\n  \u003cimg src=\"./img/started.png\" width=\"50%\"\u003e\n\n- `aborted`\n\n  \u003cimg src=\"./img/aborted.png\" width=\"50%\"\u003e\n\n- `errored`\n\n  \u003cimg src=\"./img/errored.png\" width=\"50%\"\u003e\n\n- `fixed`\n\n  Fixed is a special alert type that only alerts if the previous build did not succeed. Fixed requires `username` and `password` to be set for the resource if the pipeline is not public.\n\n  \u003cimg src=\"./img/fixed.png\" width=\"50%\"\u003e\n\n- `broke`\n\n  Broke is a special alert type that only alerts if the previous build succeed. Broke requires `username` and `password` to be set for the resource if the pipeline is not public.\n\n  \u003cimg src=\"./img/broke.png\" width=\"50%\"\u003e\n\n## Examples\n\n### Out\n\nUsing the default alert type with custom message and color:\n\n```yaml\nresources:\n- name: notify\n  type: slack-alert\n  source:\n    url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\n\njobs:\n  # ...\n  plan:\n  - put: notify\n    params:\n      message: Completed\n      color: \"#eeeeee\"\n```\n\nUsing built-in alert types with appropriate build hooks:\n\n```yaml\nresources:\n- name: notify\n  type: slack-alert\n  source:\n    url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\n\njobs:\n  # ...\n  plan:\n  - put: notify\n    params:\n      alert_type: started\n  - put: some-other-task\n    on_success:\n      put: notify\n      params:\n        alert_type: success\n    on_failure:\n      put: notify\n      params:\n        alert_type: failed\n    on_abort:\n      put: notify\n      params:\n        alert_type: aborted\n    on_error:\n      put: notify\n      params:\n        alert_type: errored\n```\n\nUsing the `fixed` alert type:\n\n```yaml\nresources:\n- name: notify\n  type: slack-alert\n  source:\n    url: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\n    # `alert_type: fixed` requires Concourse credentials if pipeline is private\n    username: concourse\n    password: concourse\n\njobs:\n  # ...\n  plan:\n  - put: some-other-task\n    on_success:\n      put: notify\n      params:\n        # will only alert if build was successful and fixed\n        alert_type: fixed\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farbourd%2Fconcourse-slack-alert-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farbourd%2Fconcourse-slack-alert-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farbourd%2Fconcourse-slack-alert-resource/lists"}