{"id":24687003,"url":"https://github.com/clipcrow/pr2slack","last_synced_at":"2026-04-12T04:37:47.701Z","repository":{"id":205567745,"uuid":"714539340","full_name":"clipcrow/pr2slack","owner":"clipcrow","description":"This Bot will notify pull-request events to your Slack channel.","archived":false,"fork":false,"pushed_at":"2024-08-06T02:56:43.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T21:44:41.045Z","etag":null,"topics":["bot","deno","deno-deploy","deno-kv","github","pull-request","slack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/clipcrow.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":"supportRouter.ts","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T06:30:14.000Z","updated_at":"2024-08-06T02:56:46.000Z","dependencies_parsed_at":"2025-03-21T21:42:50.085Z","dependency_job_id":"4f7c0e16-8a63-4b9c-b520-13373e5c0a49","html_url":"https://github.com/clipcrow/pr2slack","commit_stats":null,"previous_names":["clipcrow/pullrequest-notifier","clipcrow/pr2slack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clipcrow/pr2slack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clipcrow%2Fpr2slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clipcrow%2Fpr2slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clipcrow%2Fpr2slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clipcrow%2Fpr2slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clipcrow","download_url":"https://codeload.github.com/clipcrow/pr2slack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clipcrow%2Fpr2slack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31704492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bot","deno","deno-deploy","deno-kv","github","pull-request","slack"],"created_at":"2025-01-26T16:17:31.978Z","updated_at":"2026-04-12T04:37:47.680Z","avatar_url":"https://github.com/clipcrow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pr2slack\n\nThis will notify pull-request events to your Slack channel.\n\n## Requirements\n\nNotify the pull request reviewer that a review request is coming, Notify the\npull request author as soon as the reviewer completes the approval.\n\n- Post a message to Slack when a particular user is added as a reviewer to a\n  pull request\n- Update messages already posted at the following events\n  - Yet another specific user is added as a reviewer\n  - Reviewer completes review\n  - Pull requests are merged\n- The update history is threaded to the message\n- Mention the Slack account of the target GitHub user\n\n## How to implement\n\nThis system is designed to be hosted on Deno Deploy.\n\nPosting to Slack uses the Slack Block API to create a dialog-like appearance.\n\nUse Slack's metadata API to find messages to update. In this way, the channel is\nnot wasted. Fortunately, pull requests have a unique number, so I can simply use\nthat as my search key.\n\nGraphQL(GitHub v4) was used as the method for acquiring detailed data of pull\nrequest. It was very convenient because it took less effort than the REST\nAPI(GitHub v3).\n\nStore the bot token needed to use the Slack API in Deno Deploy Secrets. The\nSlack channel ID, Slack and Github account pair, will be stored in Deno KV.\n\nHolds a token for operating GitHub in Deno Deploy Secrets too.\n\n- serve.ts: The API server.\n  - createContext.ts: Adjust the JSON of the received webhook.\n  - postNotification.ts:\n    - getActualGraph.ts: GraphQL\n    - renderer.tsx: [jsx-slack](https://github.com/yhatt/jsx-slack)\n\n## handle event of GitHub via webhook\n\n- Event \u003e Activity Type\n  - **pull_request**\n    - opened\n      - Even if a review request is made at the same time as the PR opens, the\n        events will occur separately.\n    - **closed**\n      - When a pull request merges, the `pull_request` is automatically\n        `closed`.\n      - with a conditional that checks the `merged` value of the event. also\n        `merged_by`.\n    - edited\n    - reopened\n      - I don't know...\n    - **review_requested**\n      - see `payload.requested_reviewer`.\n    - **review_request_removed**\n      - see `payload.requested_reviewer`.\n  - **pull_request_review**\n    - **submitted**\n      - when a pull request has been approved\n      - check the `payload.review.state`, state == `approved` then PR was\n        approved.\n    - dismissed\n      - Change the state of the review, but not the state of the PR.\n  - pull_request_review_comment\n    - created\n\n## Call Slack API\n\n- **views.open**, **views.update**\n  - scope: No scope required\n- **chat.postMessage**, **chat.update**\n  - scope: `chat:write`\n- **conversations.history**\n  - scope: `channels:history`, `groups:history`, `im:history`, `mpim:history`\n- Slash command\n  - scope: `commands`\n\n### Deno Deploy Secrets settings\n\n- GITHUB_TOKEN: GitHub personal access token (classic)\n  - for example, `ghp_abcdefghijklmnopqrstuvwxyz0123456789`\n- SLACK_TOKEN: Slack Bot token with scopes as above.\n  - for example, `xoxb-1234567890123-1234567890123-abcdefghijklmnopqrstuvwx`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclipcrow%2Fpr2slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclipcrow%2Fpr2slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclipcrow%2Fpr2slack/lists"}