fix: Add GitHub project board automation for issues and PRs - #76
Merged
Conversation
- add-issues-to-project.yml: adds squad-labeled issues to project board and sets Status → Backlog - add-prs-to-project.yml: adds all new PRs to project board and sets Status → In Review - Both workflows handle 403 errors gracefully with guidance on PAT scope Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
Contributor
SummarySummary
CoverageAppHost - 0%
Domain - 87.2%
ServiceDefaults - 0%
Web - 68.7%
|
Contributor
|
There was a problem hiding this comment.
Pull request overview
This PR adds two new GitHub Actions workflows to automatically add newly opened/reopened issues and PRs to the MyBlog GitHub Project (v2) board, addressing the gap where existing automation only moved already-added items.
Changes:
- Add workflow to auto-add squad-labeled issues to the project and set Status → Backlog.
- Add workflow to auto-add new PRs to the project and set Status → In Review.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/add-issues-to-project.yml | Adds squad-labeled issues to the project board and sets Status to Backlog via GraphQL mutations. |
| .github/workflows/add-prs-to-project.yml | Adds PRs to the project board and sets Status to In Review via GraphQL mutations. |
Comment on lines
+24
to
+27
| uses: actions/github-script@v9 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | |
|
|
||
| core.info(`✅ Issue #${issue.number} added to project → Backlog`); | ||
| } catch (err) { | ||
| if (err.message.includes('403')) { |
Comment on lines
+3
to
+6
| on: | ||
| pull_request: | ||
| types: [opened, reopened] | ||
|
|
Comment on lines
+23
to
+25
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | |
Comment on lines
+70
to
+75
| } catch (err) { | ||
| if (err.message.includes('403')) { | ||
| core.warning(`Access denied (403). If this persists, create a PAT with 'project' scope and store as secrets.GH_PROJECT_TOKEN`); | ||
| } else { | ||
| core.warning(`Could not add PR to project: ${err.message}`); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #76
Working as Boromir (DevOps / Infra)
The existing
project-board-automation.ymlonly moves items between columns — it never added new issues or PRs to the board in the first place. This PR fills that gap with two dedicated workflows.Changes
add-issues-to-project.ymlissues: [opened, reopened]squad(avoids noise from unrelated issues)addProjectV2ItemByIdf75ad846)projectscopeadd-prs-to-project.ymlpull_request: [opened, reopened]df73e18b)Project IDs used
PVT_kwHOA5k0b84BVFTyPVTSSF_lAHOA5k0b84BVFTyzhQjgPkf75ad846df73e18bNotes
Both workflows use
secrets.GITHUB_TOKEN. If GitHub's fine-grained token restrictions block project writes (403), a PAT with theprojectscope stored assecrets.GH_PROJECT_TOKENcan be substituted.