You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: workflows/issue-project-sync/README.md
+7-14Lines changed: 7 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,20 @@
1
1
# Issue Project Sync Workflow
2
2
3
-
A reusable composite action that automatically adds issues to [cloudoperators project #9](https://github.com/orgs/cloudoperators/projects/9) when the `backlog` label is applied.
3
+
A reusable composite action that automatically adds issues to [cloudoperators project #9](https://github.com/orgs/cloudoperators/projects/9) when the `backlog` label is applied. Uses the official [actions/add-to-project](https://github.com/actions/add-to-project) action under the hood.
4
4
5
5
## Usage
6
6
7
-
Create `.github/workflows/issue-project-sync.yml` in your repository:
7
+
Create `.github/workflows/issue-project-sync.yaml` in your repository:
8
8
9
9
```yaml
10
10
name: Issue Project Sync
11
11
on:
12
12
issues:
13
13
types: [labeled]
14
14
15
+
permissions:
16
+
issues: read
17
+
15
18
jobs:
16
19
sync:
17
20
if: github.event.label.name == 'backlog'
@@ -26,7 +29,7 @@ jobs:
26
29
27
30
1. Triggered when any label is added to an issue
28
31
2. Filters to only run when the `backlog` label is applied
29
-
3. Uses the GitHub GraphQL API to add the issue to the organization project
32
+
3. Uses `actions/add-to-project` to add the issue to the organization project
| `PROJECT_NUMBER` | No | `9` | The GitHub project number to add issues to |
65
-
| `ORG` | No | `cloudoperators` | The GitHub organization owning the project |
66
-
67
-
## How it works
68
-
69
-
The action uses the GitHub GraphQL API to:
70
-
71
-
1. Look up the project node ID from the org and project number
72
-
2. Add the issue (by its node ID) to the project using `addProjectV2ItemById`
73
-
74
-
This replaces the built-in GitHub Project "Auto-add" UI workflow with a code-based approach that can be version-controlled and applied consistently across repositories.
67
+
| `PROJECT_URL` | No | `https://github.com/orgs/cloudoperators/projects/9` | Full URL of the GitHub project |
0 commit comments