{"id":22327431,"url":"https://github.com/rewindio/github-to-slack-notifier","last_synced_at":"2025-03-26T06:23:08.559Z","repository":{"id":263638748,"uuid":"831136110","full_name":"rewindio/github-to-slack-notifier","owner":"rewindio","description":"A GitHub action to notify Slack user of GitHub events","archived":false,"fork":false,"pushed_at":"2025-01-27T22:40:40.000Z","size":50,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-31T07:45:44.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/rewindio.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-19T18:40:48.000Z","updated_at":"2024-12-11T19:01:44.000Z","dependencies_parsed_at":"2024-12-11T16:28:16.805Z","dependency_job_id":"d7218e13-d4b4-4565-810b-d75c1bb02bc2","html_url":"https://github.com/rewindio/github-to-slack-notifier","commit_stats":null,"previous_names":["rewindio/github-to-slack-notifier"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Fgithub-to-slack-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Fgithub-to-slack-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Fgithub-to-slack-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rewindio%2Fgithub-to-slack-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rewindio","download_url":"https://codeload.github.com/rewindio/github-to-slack-notifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245599580,"owners_count":20642130,"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":[],"created_at":"2024-12-04T03:09:25.975Z","updated_at":"2025-03-26T06:23:08.535Z","avatar_url":"https://github.com/rewindio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github to Slack Notifier\n\nA Github action to send a Slack Direct Message.\n\nThis action finds the corporate e-mails of a git user in the configured org and sends a DM to a user in Slack with the same corporate e-mail address\n\n## Usage\n\n### Using the pre-built container\n\n```yaml\njobs:\n  send-slack-dm:\n    name: Send a Slack DM\n    runs-on: ubuntu-latest\n\n    steps:\n     name: Send Slack DM to user on deploy failure\n     id: send-slack-dm\n     uses: docker://ghcr.io/rewindio/github-to-slack-notifier:latest\n     with:\n        github_token: ${{ secrets.GITHUB_USER_LOOKUP_TOKEN }}\n        slack_bot_token: ${{ secrets.SLACK_DM_TOKEN }}\n        github_org: ${{ github.repository_owner }}\n        list_of_github_users: \"github_user\"\n        message: \"Hello!\"\n```\n\n### Building the container on each Github Action run\n\n```yaml\njobs:\n  send-slack-dm:\n    name: Send a Slack DM\n    runs-on: ubuntu-latest\n\n    steps:\n     name: Send Slack DM to user on deploy failure\n     id: send-slack-dm\n     uses: rewindio/github-to-slack-notifier@v{VERSION_TAG}\n     with:\n        github_token: ${{ secrets.GITHUB_USER_LOOKUP_TOKEN }}\n        slack_bot_token: ${{ secrets.SLACK_DM_TOKEN }}\n        github_org: ${{ github.repository_owner }}\n        list_of_github_users: \"github_user\"\n        message: \"Hello!\"\n```\n\nThis will build the `github-to-slack-notifier` action container on each workflow run.\n\nThe docker build may hang when the action builds the container.\n\nTo prevent long action run times, using the pre-built container is recommended.\n\n## Input Variables\n\nThe action requires the following input variables:\n\n| Input              | Description   |\n| :---------------- | :------: |\n| github_token                 |   Github token. See below for required permissions.  |\n| slack_bot_token                 |  Slack OAuth token. See below for required permissions. |\n| github_org                 |  Github Org ID  |\n| list_of_github_users | List of users to DM. See Github Users for more information. |\n| message | Message to send to user(s) |\n\n### GITHUB_TOKEN permissions\n\nThe default `GITHUB_TOKEN` will not have sufficent permissions to look-up the user's verified corporate e-mail addresses.\nThe supplied `GITHUB_TOKEN` will require the `read:org` permissions.\n\n### SLACK_TOKEN permissions\n\nThe `SLACK_TOKEN` will require the following scopes:\n\n| Scope              | Reason   |\n| :---------------- | :------: |\n| users:read.email  |  Required by the `users.lookupByEmail` method.  |\n| chat:write        | Required by the `chat.postMessage` method. |\n| channels:manage | Required by the `conversations.open` method. |\n| groups:write | Required by the `conversations.open` method. |\n| im:write | Required by the `conversations.open` method. |\n| mpim: write | Required by the `conversations.open` method. |\n\n## Exit Codes\n\nGithub to Slack Notifier can exit with the following codes:\n\n| Code              | Reason   |\n| :---------------- | :------: |\n| 0                 |   Everything went well  |\n| 1                 | Error querying API/GraphQL |\n| 2                 |   Missing required input variables. See logs.  |\n\n## Github Users\n\nThe parameter `list_of_github_users` accepts a list of users to notify. This list can be a single string, comma-separated string or a JSON list of strings. (\"user\", '[\"user\"'], \"user1,user2,user3\").\n\nThe list of users can be of the following values:\n    - Private Github email address. This is in the format of `{ID}+{user}@users.noreply.github.com`\n    - Private Github email address without ID prepend. This is in the format of `{user}@users.noreply.github.com`\n    - An email address. This is in the format of `user@company.com`. Or\n    - Github username.\n\n[See Github documentation on profiles to understand why there are two formats of Github private email addresses](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#about-commit-email-addresses)\n\n## A note about e-mails\n\nOrganization e-mail(s) for a user is only available if the e-mail domain is verified for the Github organization.\n[See Github documentation for this procedure](https://docs.github.com/en/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frewindio%2Fgithub-to-slack-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frewindio%2Fgithub-to-slack-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frewindio%2Fgithub-to-slack-notifier/lists"}