Assign Prototype Milestone โ
Workflow: assign-milestone.yml
Status: โ
Active
Overview โ
Automatically assigns the Prototype milestone to every new GitHub issue so nothing falls through the cracks. A workflow_dispatch trigger lets you backfill all existing open issues at any time.
What It Does โ
Triggers โ
| Trigger | Behavior |
|---|---|
issues: opened | Assigns "Prototype" milestone to the new issue (skips if already set) |
workflow_dispatch | Backfills all open issues that currently have no milestone |
Logic โ
New issue opened
โ
Does it already have a milestone? โ YES โ skip
โ NO
Assign "Prototype" milestoneworkflow_dispatch (backfill)
โ
Get or create "Prototype" milestone
โ
Paginate all open issues
โ (for each)
Has milestone? โ YES โ skip
โ NO
Assign "Prototype" milestone
โ
Report summaryIf the "Prototype" milestone does not exist, the workflow creates it automatically before assigning.
Running the Backfill โ
Via GitHub UI โ
- Go to Actions โ Assign Prototype Milestone
- Click Run workflow
- Options:
- Backfill:
true(default) โ processes all open issues - Dry-run:
trueโ preview without making changes
- Backfill:
- Click Run workflow
Via gh CLI โ
bash
# Preview changes (dry-run)
gh workflow run assign-milestone.yml \
-f backfill=true \
-f dry_run=true
# Apply changes
gh workflow run assign-milestone.yml \
-f backfill=true \
-f dry_run=falseMilestone Lifecycle โ
| Phase | Action |
|---|---|
| Prototype (current) | All new issues assigned here automatically |
| Future milestone | Update MILESTONE_NAME env var in the workflow, or configure GITHUB_MILESTONE_NAME in the Discord bot (.env) |
| Post-launch | Change the default milestone name or remove auto-assignment |
Changing the Default Milestone โ
Two places to update when moving to a new milestone:
assign-milestone.ymlโ changeMILESTONE_NAME: "Prototype"to the new name- Discord bot โ set
GITHUB_MILESTONE_NAME=NewMilestoneNamein the bot's.env
Configuration โ
| Variable | Default | Description |
|---|---|---|
MILESTONE_NAME | "Prototype" | Name of the milestone to assign |
DRY_RUN | false | Preview mode (no API writes) |
GH_PAT secret | Falls back to GITHUB_TOKEN | Token for API calls; use a PAT if github.token lacks milestone write permission |
Permissions โ
The workflow requests issues: write which is sufficient to update milestone assignments using the default GITHUB_TOKEN. No additional secrets are required for standard repos.
Related โ
- Discord bot (
services/bots/discord/bot.js) โ also assigns "Prototype" milestone to issues created via Discord slash commands (GITHUB_MILESTONE_NAMEenv var) - Issue #81 โ original task that requested this workflow
- Issue #299 โ bulk backfill task that prompted the
workflow_dispatchtrigger