Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c2fbff1
chore: auto-close stale release PRs after 3 hours of inactivity
cryptodev-2s Jul 24, 2026
0fd851f
fix: harden stale release PR closer against races and failed closes
cryptodev-2s Jul 24, 2026
d9cf151
fix: continue past failed PR refresh and merge-state checks
cryptodev-2s Jul 24, 2026
e0f1468
fix: recheck PR activity immediately before close and delete
cryptodev-2s Jul 24, 2026
6495138
fix: verify full label set and branch tip before delete
cryptodev-2s Jul 24, 2026
1538aed
fix: comment after branch delete with accurate status
cryptodev-2s Jul 24, 2026
0c750f5
refactor: extract stale release closer into a script with inline cons…
cryptodev-2s Jul 24, 2026
792c39e
refactor: split stale release closer into scoped helpers and fix JSDo…
cryptodev-2s Jul 24, 2026
7c1b13c
style: format close-stale-release-prs script
cryptodev-2s Jul 24, 2026
9033954
Merge branch 'main' into chore/close-stale-release-prs
cryptodev-2s Jul 27, 2026
365060a
refactor: address clear-win review nits on stale release closer
cryptodev-2s Jul 28, 2026
624f814
refactor: migrate stale release closer to TypeScript with @actions pa…
cryptodev-2s Jul 28, 2026
41a0728
Merge branch 'main' into chore/close-stale-release-prs
cryptodev-2s Jul 28, 2026
a2ccde0
fix: make stale release closer an ESM .mts module
cryptodev-2s Jul 28, 2026
364d420
fix: clarify tip-move skip vs delete failure in close comment
cryptodev-2s Jul 28, 2026
f2e984d
fix: type listed PRs from Octokit instead of casting
cryptodev-2s Jul 28, 2026
12e7ee4
refactor: drop double-snapshot race dance before stale close
cryptodev-2s Jul 28, 2026
3f8f445
refactor: apply utils helpers and small closer review nits
cryptodev-2s Jul 28, 2026
a9dfaae
refactor: rename snapshotLabelNames to pullRequestLabelNames
cryptodev-2s Jul 28, 2026
3457b77
refactor: make merge-in-progress check an explicit boolean
cryptodev-2s Jul 28, 2026
7a05448
refactor: include stale threshold in not-yet-stale skip log
cryptodev-2s Jul 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/close-stale-release-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Close Stale Release PRs

# Release PRs on `release/*` branches are expected to merge quickly. Abandoned
# ones block other engineers from starting a new release. This workflow closes
# inactive release PRs, leaves a comment, and deletes the branch.
on:
schedule:
# Check twice an hour so the 3h window is reasonably precise.
- cron: '*/30 * * * *'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: close-stale-release-prs
cancel-in-progress: false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think this is the default: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#concurrency

Suggested change
cancel-in-progress: false


jobs:
close-stale-release-prs:
name: Close stale release PRs
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
with:
is-high-risk-environment: false
persist-credentials: false
cache-node-modules: true
Comment on lines +31 to +32

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these two options? persist-credentials no longer stores the token in the repo in actions/checkout@v6 (we are using v7 in action-checkout-and-setup). And since we aren't running the checkout step in one job and reusing the result in another job we don't need to cache Node modules.

Suggested change
persist-credentials: false
cache-node-modules: true

- name: Close inactive release PRs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn tsx scripts/close-stale-release-prs.mts
1 change: 1 addition & 0 deletions docs/processes/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Have changes that you need to release? There are a few things to understand:

- The responsibility of maintenance is not the only thing shared among multiple teams at MetaMask; releases are as well. That means **if you work on a team that has codeownership over a package, you are free to create a new release without needing the Wallet Framework team to do so.**
- Unlike clients, releases are not issued on a schedule; **anyone may create a release at any time**. Because of this, you may wish to review the Pull Requests tab on GitHub and ensure that no one else has a release candidate already in progress. If not, then you are free to start the process.
- Release PRs on `release/*` branches that sit inactive for **3 hours** are automatically closed, with the branch deleted, so abandoned releases do not block others. Add the `release:keep-open` label if you need a longer-lived release PR in exceptional cases.
- The release process is a work in progress. Further improvements to simplify the process are planned, but in the meantime, if you encounter any issues, please reach out to the Wallet Framework team.
- Breaking changes take special consideration. [Read the guide](./breaking-changes.md) on how to prepare and handle them effectively.

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"workspaces:list-versions": "./scripts/list-workspace-versions.sh"
},
"devDependencies": {
"@actions/core": "^3.0.1",
"@actions/github": "^9.1.1",
"@lavamoat/allow-scripts": "^3.0.4",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/create-release-branch": "^4.2.1",
Expand Down
Loading