Github Actions: Workflow 82 - Post Kanban board summary to team slack channel
The workflow 82-kanban-slack-update.yml
was written by Ahsun Tariq as part of his research into the impact of reflection on Software Engineering Education. Phill Conrad also made contributions.
The purpose of the workflow is to provide the team with a summary of the state of the Kanban board at periodic intervals, showing the number of issues each team member has in the various columns of the Kanban board.
Installation
To install this in your project, you need to take several steps.
Step 1: Copy workflow
Copy the workflow file into your repo, in the .github/workflows
directory.
Step 2: Configure Org to allow fine-grained personal access tokens
Go to the settings for the organization, and navigate to Personal Access Tokens / Settings
You can also use this link (editing the organization as needed):
Step 3: Create a fine-grained Personal Access Token (PAT
)
Create a fine grained personal access token for the organization.
Under organizations, it should have read-only permission on projects.
Once you have the secret, keep the browser window open, since you’ll need this value in the next step, and once you navigate away from the window, the value is no longer available.
Step 4: Add Secret PAT
to Organization Secrets
In a different web browser, navigate to your Organization Secrets, found here:
Or, use this link (editing to replace the organization):
Click , and add the secret with the name PAT
, and the value of the fine grained personal access token from the previous step.
Choose either All Repositories
or select the repositorires to which this should be applied.
Step 5: Create a Slack bot user
To create a slack bot user, start here: https://api.slack.com/apps/
Instructions | Screenshot |
---|---|
You’ll see this screen. Click . | |
You’ll see this modal. Choose “From Scratch” | |
For App Name , choose something like Kanban Board Update , and then select your Slack workspace, and click | |
That will take you to this screen. Now you need to look for OAuth and Permission in the left navigation | } |
Click on this | |
Scroll down to here | |
Add these scopes: | |
Then scroll back up to OAuth Tokens and click the button | |
You’ll see a screen like this. Click Allow | |
You’ll then be shown the OAuth Token value (redacted here). Leave this window open so that you can copy this value in the next step. |
Step 6: Copy OAuth token to org secrets as SLACK_BOT_USER_OAUTH_ACCESS_TOKEN
In a different web browser, navigate to your Organization Secrets, found here:
Or, use this link (editing to replace the organization):
Click , and add the secret with the name SLACK_BOT_USER_OAUTH_ACCESS_TOKEN
, and the value of the OAuth token from Slack from the previous step.
Choose either All Repositories
or select the repositorires to which this should be applied.
Step 7: Update the TEAM_TO_CHANNEL environment variable
Now, you need to collect the Slack Channel Ids of each team channel. For example, if your teams are named f24-00
, f24-01
, f24-02`, you need to construct a JSON object that looks like this:
{ "f24-00" : "C08018C6ZUY", "f24-01" : "C07PYJKCWEL", "f24-02" : "C07P9QKLCSW" }
To obtain the channel numbers, you can right click on each team channel in Slack, and select View Channel Details
:
The window that comes up has the channel id as the very bottom, with a widget you can click to copy it.
Assemble this JSON object; you’ll need it for the next step.
Step 8: Update the TEAM_TO_CHANNEL environment variable
Under the organization settings, find Secrets and Variables / Actions
On the page that comes up, choose the second tab, Variables
:
Or, use this direct link (changing the organization name as needed):
Create a new variable called TEAM_TO_CHANNEL
with the settings from the JSON object you created in the previous step.