command
module
Version:
v0.0.0-...-1e61c20
Opens a new window with list of versions in this module.
Published: Sep 18, 2022
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Github Notifications To Slack

Notify Slack of your github notifications, which can be scheduled to run using Github Actions.
actions
Slack
You can register a white list and black list of repositories to be notified.
Usage
- Need to create a slack bot. Access Slack Applications.
- [Create new app] -> [From scratch]
- [OAuth & Permissions] -> Add chat:write to Bot Token Scopes and re install.
- Create a github token. Access Personal access tokens, Tokens require the score of repo, notifications.
- Create a repository to run scheduled notifications github actions and create the following Actions.
.github/workflows/slack-notify.yml
on:
schedule:
- cron: "*/10 * * * *"
jobs:
notify:
runs-on: ubuntu-latest
name: notify
steps:
- uses: actions/checkout@v3
- name: Github Notifications To Slack
uses: shzxcv/github-notifications-to-slack@v1
env:
NOTIFICATION_GITHUB_TOKEN: ${{ secrets.NOTIFICATION_GITHUB_TOKEN }}
SLACK_BOT_OAUTH_TOKEN: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }}
SLACK_USER_ID: ${{ secrets.SLACK_USER_ID }}
- Register environment variables in the Actions secrets.
Environment Variables
| Variable |
Required |
Purpose |
| NOTIFICATION_GITHUB_TOKEN |
true |
The token of the github account. repo and notifications scopes are required. |
| SLACK_BOT_OAUTH_TOKEN |
true |
bot token for the slack app to be notified. chat:write is required. |
| SLACK_CHANNEL |
false |
Specify the slack channel to be notified. (#test-channel)
* Either SLACK_CHANNEL or SLACK_USER_ID is required. |
| SLACK_USER_ID |
false |
The user id of the slack user to whom the Direct Message will be sent.(U01ABCD23EF)
* Either SLACK_CHANNEL or SLACK_USER_ID is required. |
| INCLUDE_GITHUB_REPOS |
false |
Repository to be included in the notification. (shzxcv/repo1,shzxcv/repo2)
* If the same repository is registered in INCLUDE_GITHUB_REPOS and EXCLUDE_GITHUB_REPOS, INCLUDE_GITHUB_REPOS has priority. |
| EXCLUDE_GITHUB_REPOS |
false |
Repository to exclude notifications. (shzxcv/repo1,shzxcv/repo2) |
License
MIT
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.