A Github Action to sync labels between Clubhouse Story and its linked Pull Request
Create a Clubhouse API token,
and store it as an encrypted secret in your GitHub repository settings.
Check the GitHub documentation for how to create an encrypted secret.
Name this secret CLUBHOUSE_TOKEN
.
Create a workflow (eg: .github/workflows/labeler.yml
see Creating a Workflow file) to utilize the labeler action with content:
name: "Clubhouse Labeler"
on:
pull_request:
types: [labeled, unlabeled]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: amblerhq/gh-actions-clubhouse-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
clubhouse-token: ${{ secrets.CLUBHOUSE_TOKEN}}
Note: This grants access to the GITHUB_TOKEN
so the action can make calls to GitHub's rest API
Create missing labels on Clubhouse (with same color than in GitHub).
Restrict synchronization to some labels only. If not set, a Clubhouse label will be removed from the story if it is not present on PR and exists in the GitHub repository
Map Clubhouse label name to a GitHub label name
name: "Clubhouse Labeler"
on:
pull_request:
types: [labeled, unlabeled]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: amblerhq/gh-actions-clubhouse-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
clubhouse-token: ${{ secrets.CLUBHOUSE_TOKEN}}
create-if-missing: true
synced-clubhouse-labels: |
[
"📖 doc"
]
label-ch-gh-map: |
{
"📖 doc": "documentation"
}
This workflow will synchronize only 📖 doc
Clubhouse label, create it if needed and link it from documentation
label on GitHub