Create GitHub Action to label current sprint issues (#1420)#1422
Create GitHub Action to label current sprint issues (#1420)#1422
Conversation
|
I need to merge to test it |
KochTobi
left a comment
There was a problem hiding this comment.
Seems to do what is requested. Hard to read but I could not find anything dangerous.
| schedule: | ||
| # Run twice daily: 8 AM and 8 PM UTC | ||
| - cron: "0 8 * * *" | ||
| - cron: "0 20 * * *" | ||
| workflow_dispatch: # Manual trigger for testing |
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 |
There was a problem hiding this comment.
This can be increased to checkout@v6
|
|
||
| - name: Sync sprint labels | ||
| env: | ||
| GH_TOKEN: ${{ secrets.ISSUE_MANAGEMENT }} |
There was a problem hiding this comment.
Why do you need a token here? The permission settings in the job should give the generated github token enough permissions. No need to maintain a second token.
| GH_TOKEN: ${{ secrets.ISSUE_MANAGEMENT }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
see https://docs.github.com/en/actions/tutorials/authenticate-with-github_token
| CURRENT_SPRINT=$(cat project_items.json | jq -r --arg today "$TODAY" ' | ||
| [.items[].iteration | select(. != null)] | | ||
| unique | | ||
| .[] | | ||
| select(.startDate <= $today and .duration.endDate >= $today) | | ||
| .id | ||
| ' | head -1) | ||
|
|
There was a problem hiding this comment.
I do not understand this part.
What I gathered:
list items from file -> get date -> select all non null -> remove duplicates -> ? -> filter for date -> select the first
| echo "WARNING: No active sprint found for today ($TODAY)" | ||
| echo "Checking all iterations in project..." | ||
| cat project_items.json | jq -r '[.items[].iteration | select(. != null)] | unique | .[] | "\(.id): \(.title) (\(.startDate) to \(.duration.endDate))"' || true | ||
| echo "Exiting - no active sprint to process" |
9f6bdea to
6d04a12
Compare
- Runs twice daily (8 AM and 3 PM UTC) - Syncs sprint:current label with Project #24 sprint assignments - Adds label to issues in current sprint - Removes label from issues no longer in sprint - Supports manual workflow_dispatch trigger for testing - Uses GITHUB_TOKEN instead of ISSUE_MANAGEMENT secret Resolves #1420
6d04a12 to
d9401c5
Compare
|



Description
This PR implements the GitHub Action requested in #1420 to automatically label issues that are part of the current sprint.
Features
workflow_dispatchfor testingsprint:currentlabel to issues in the current sprintsprint:currentlabel from issues no longer in the sprintTechnical Details
.github/workflows/label_sprint_issues.ymlissues: writefor labelingISSUE_MANAGEMENTsecret (same as existing project workflows)Testing
The workflow can be triggered manually for testing:
Checklist
ISSUE_MANAGEMENTsecret)Resolves #1420