Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 21, 2025

This PR adds automation to the publish workflow to fully manage GitHub milestones during releases. When a new stable version is published, the workflow will now automatically:

  1. Create a milestone named with the version number (e.g., "1.2.3")
  2. Move all issues and PRs from the "Planned" milestone to the new version milestone
  3. Handle edge cases like existing milestones and empty planned milestones

Implementation Details

New Script: .github/bot/src/milestone-manager.ts

  • Uses the existing Octokit setup for GitHub API interactions
  • Creates a milestone for the published version with proper error handling
  • Finds and processes all items in the "Planned" milestone
  • Moves issues and PRs to the new milestone with comprehensive logging
  • Gracefully handles cases where milestones already exist or no items need moving

Workflow Integration: .github/workflows/publish.yml

  • Added new manage-milestone job that runs after git-tag-stable
  • Only executes for stable releases (skipped for nightly builds)
  • Uses existing authentication and setup actions
  • Runs the milestone management script with the published version

Benefits

  • Eliminates manual milestone management - no more need to manually create milestones and move issues
  • Ensures consistency - every release gets a proper milestone with all planned items
  • Maintains workflow reliability - uses existing infrastructure and authentication
  • Provides clear logging - comprehensive output for debugging and verification

The automation runs at the perfect time in the workflow - right after the stable git tag is created but before npm publishing begins, ensuring the milestone is ready when the release is complete.

Fixes #11017.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/swc-project/swc/milestones
    • Triggering command: node /home/REDACTED/work/swc/swc/node_modules/.bin/ts-node .github/bot/src/milestone-manager.ts 1.2.3 (http block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Contributor Author

Copilot AI commented Aug 21, 2025

@kdy1 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2025

⚠️ No Changeset found

Latest commit: 17bd969

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Automate publishing action fully Automate milestone management in publish workflow Aug 21, 2025
Copilot AI requested a review from kdy1 August 21, 2025 10:23
Copilot finished work on behalf of kdy1 August 21, 2025 10:23
@kdy1 kdy1 marked this pull request as ready for review August 21, 2025 10:24
@kdy1 kdy1 requested a review from a team as a code owner August 21, 2025 10:24
@kdy1 kdy1 added this to the Planned milestone Aug 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 21, 2025

CodSpeed Performance Report

Merging #11018 will not alter performance

Comparing copilot/fix-11017 (17bd969) with main (934d8a5)

Summary

✅ 140 untouched benchmarks

@kdy1 kdy1 changed the title Automate milestone management in publish workflow chore: Automate milestone management while publishing Aug 21, 2025
@kdy1 kdy1 merged commit 8ed5da7 into main Aug 21, 2025
168 of 171 checks passed
@kdy1 kdy1 deleted the copilot/fix-11017 branch August 21, 2025 10:27
@github-actions github-actions bot modified the milestones: Planned, 1.13.5 Aug 24, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Automate publishing action fully

3 participants