This repository is for testing and demonstrating various GitHub Actions workflows.
This repository includes GitHub Action workflows that automatically manage the Release field for issues and pull requests based on Priority values and VERSION file contents.
Periodically syncs the Release field on issues based on Priority changes.
- Runs every 10 minutes
- Only updates Release when Priority actually changes (not just when they don't match)
- Handles both new issues and Priority changes
- Preserves manual Release field updates - won't overwrite them unless Priority changes again
- Uses GitHub Actions cache to track previous Priority values
- Can be manually triggered via GitHub Actions UI for immediate sync
Priority Mapping:
- 0 or 1: Release field set to current release (from VERSION file, e.g.,
25.12) - 2 or higher: Release field set to
Backlog
Triggers:
- Schedule: Every 10 minutes (
*/10 * * * *) - Manual:
workflow_dispatch(can be triggered manually from Actions tab)
How it works:
- Queries the target project directly for all issues
- Caches Priority values from each run
- On next run, compares current Priority to cached Priority
- Only updates Release if Priority has changed since last run (or is a new issue)
- This allows you to manually override Release values - they won't be overwritten unless you change Priority again
Automatically sets the Release field on pull requests based on the VERSION file in the PR's base branch.
- Release field set to the first 2 segments of the VERSION file (e.g.,
25.12.00→25.12)
Triggers:
- When a PR is opened, edited, synchronized (new commits), or reopened
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "Project Automation Workflows")
- Select the following scopes:
repo(Full control of private repositories)project(Full control of projects)
- Click "Generate token"
- Copy the token value (you won't be able to see it again!)
- Go to this repository's Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
PROJECT_TOKEN - Value: Paste the PAT you created in Step 1
- Click "Add secret"
Your GitHub Project must have the following fields:
-
Priority (Single select field)
- Options:
0,1,2,3, etc. - Used to determine release assignment for issues
- Options:
-
Release (Single select field)
- Will be automatically populated by workflows
- Must include options for:
- Current and future version numbers (e.g.,
25.12,25.11, etc.) Backlog(capitalized exactly as shown)
- Current and future version numbers (e.g.,
- The workflows will warn you via comments if an option is missing
For the automation to work:
- Issues must be added to a GitHub Project with Priority and Release fields
- PRs must be added to a GitHub Project with a Release field
- The workflows will automatically update the Release field based on the rules above
The VERSION file contains a 3-segment version (e.g., 25.12.00), but the Release field only uses 2 segments (e.g., 25.12). The workflows automatically parse and truncate the version.
Priority → Release Mapping:
├─ 0 → Current version (e.g., 25.12)
├─ 1 → Current version (e.g., 25.12)
└─ 2+ → Backlog
All PRs get their Release field set based on the VERSION file in their base branch (not the PR branch). This ensures PRs are tagged with the release they're targeting.
Both workflows provide feedback via comments on issues/PRs:
- ✅ Success: Confirms the Release field was updated
⚠️ Warning: Missing fields or project not configured- ❌ Error: Provides error details and troubleshooting tips
Issue: "Could not find Release field in project"
- Ensure your GitHub Project has a field named exactly "Release"
- Check that issues/PRs are added to the project
Issue: "Failed to update Release field" with permission error
- Verify the
PROJECT_TOKENsecret is set correctly - Ensure the PAT has
repoandprojectscopes - Check that the PAT hasn't expired
Issue: Workflow doesn't run
- Check that issues/PRs are in a GitHub Project
- Verify the workflow files are in
.github/workflows/directory - Check the Actions tab for any workflow errors
The VERSION file in this repository controls the release version used by the workflows. To change the current release, update the VERSION file and commit the change.