A reusable composite action that automatically adds issues to cloudoperators project #9 when the backlog label is applied. Uses the official actions/add-to-project action under the hood.
Create .github/workflows/issue-project-sync.yaml in your repository:
name: Issue Project Sync
on:
issues:
types: [labeled]
permissions:
issues: read
jobs:
sync:
if: github.event.label.name == 'backlog'
runs-on: ubuntu-latest
steps:
- uses: cloudoperators/common/workflows/issue-project-sync@main
with:
GH_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }}- Triggered when any label is added to an issue
- Filters to only run when the
backloglabel is applied - Uses
actions/add-to-projectto add the issue to the organization project
This workflow requires a GitHub token with elevated permissions to write to organization projects. Set this up once at the org level:
- Go to GitHub → cloudoperators → Settings → Secrets and variables → Actions
- Click New organization secret
- Configure:
- Name:
GH_PROJECT_TOKEN - Value: A Personal Access Token (classic) or GitHub App token with scopes:
project(read/write)repo(to read issue metadata)
- Repository access: Select the repositories using this workflow:
greenhouseshoot-grafterrepo-guardcloudctlowner-label-injector
- Name:
The backlog label must exist in the repository:
gh label create "backlog" --color "0e8a16" --description "Ready for sprint planning; triggers project addition" --repo cloudoperators/<repo-name>| Input | Required | Default | Description |
|---|---|---|---|
GH_TOKEN |
Yes | — | GitHub token with project scope (org-level secret) |
PROJECT_URL |
No | https://github.com/orgs/cloudoperators/projects/9 |
Full URL of the GitHub project |