{"id":17132212,"url":"https://github.com/bitsofinfo/slack-payload-handler","last_synced_at":"2025-03-24T05:18:46.504Z","repository":{"id":146759338,"uuid":"239859463","full_name":"bitsofinfo/slack-payload-handler","owner":"bitsofinfo","description":"Tekton EventListener Webhook interceptor target intended to simplify dealing w/ slack interactive messages \u0026 slack slash commands","archived":false,"fork":false,"pushed_at":"2020-10-02T20:01:09.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-24T07:19:46.280Z","etag":null,"topics":["kubernetes","slack","tekton-triggers","tektoncd"],"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/bitsofinfo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-02-11T20:37:15.000Z","updated_at":"2024-06-19T10:16:37.059Z","dependencies_parsed_at":null,"dependency_job_id":"8881e601-a25b-462c-a2d6-3928f650bd20","html_url":"https://github.com/bitsofinfo/slack-payload-handler","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fslack-payload-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fslack-payload-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fslack-payload-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fslack-payload-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitsofinfo","download_url":"https://codeload.github.com/bitsofinfo/slack-payload-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245212311,"owners_count":20578443,"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":["kubernetes","slack","tekton-triggers","tektoncd"],"created_at":"2024-10-14T19:26:23.068Z","updated_at":"2025-03-24T05:18:46.476Z","avatar_url":"https://github.com/bitsofinfo.png","language":"Go","readme":"# slack-payload-handler\n\n[![Docker build](https://img.shields.io/docker/cloud/automated/bitsofinfo/slack-payload-handler)](https://hub.docker.com/repository/docker/bitsofinfo/slack-payload-handler)\n\nSimple utility you can use as a custom [Tekton triggers webhook interceptor](https://github.com/tektoncd/triggers/blob/master/docs/eventlisteners.md#Webhook-Interceptors) when receiving [Slack interactive message payloads](https://api.slack.com/interactivity/handling#payloads) in response to user interaction (i.e. clicking on buttons etc) to trigger things in your Tekton CICD system. It can also be used respond to [Slack slash commands](https://api.slack.com/interactivity/slash-commands#app_command_handling).\n\nFor Slack interactive message posts, for convience it lightly mutates the original JSON and adds an `action_values` property which is just an array of the selected `values` under `actions`. Completely ignorable if you don't want to use it.\n\nThere are no additional mutations for Slack slash command posts.\n\n## Usage\n\n```\nUsage of ./slack-payload-handler:\n  -debug-request\n        Optional, print requests to STDOUT, default false\n  -debug-response\n        Optional, print responses to STDOUT, default false\n  -listen-port int\n        Optional, port to listen on, default 8080 (default 8080)\n```\n\n## Docker example\n```\ndocker run -p 8080:8080 -it bitsofinfo/slack-payload-handler \\\n  slack-payload-handler --debug-request true --debug-response true --listen-port 8080\n```\n\n## Example\n\nSimulate a interactive message post:\n```\n$\u003e ./slack-payload-handler --debug-request true --debug-response true\n\n$\u003e curl -k -X POST localhost:8080 --data-urlencode 'payload={\"x\":\"b\",\"actions\":[{\"value\":\"1\"}]}'\n\n{\"action_values\":[\"1\"],\"actions\":[{\"value\":\"1\"}],\"x\":\"b\"}\n```\n\nSimulate a slash command message post:\n```\n$\u003e ./slack-payload-handler --debug-request true --debug-response true\n\n$\u003e curl --location --request POST 'http://localhost:8080/' \\\n--header 'Content-Type: application/x-www-form-urlencoded' \\\n--data-urlencode 'token=123' \\\n--data-urlencode 'command=mycommand' \\\n--data-urlencode 'dog=cat'\n\n{\"command\":\"mycommand\",\"dog\":\"cat\",\"token\":\"123\"}\n```\n\n## Test slack dummy payload\n\n```\n$\u003e ./slack-payload-handler --debug-request true --debug-response true\n\n$\u003e curl -k -X POST localhost:8080 --data-urlencode \"payload=$(cat slack.test.json)\"\n\n```\n\n## See an example of it in use\n\nhttps://github.com/bitsofinfo/cicdstatemgr/tree/master/examples/tekton\n\n## notes\n\nhttps://github.com/nlopes/slack/pull/638\n\nhttps://github.com/gorilla/mux/issues/531\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fslack-payload-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitsofinfo%2Fslack-payload-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fslack-payload-handler/lists"}