Files
metabase/.github/workflows/check-milestone.yml
Fraser 355a5fc29c Use bun package manager (#68170)
* Use bun in package.json

* Update workflows

* Update more workflows

* Kick ci

* Fix yaml

* Fix type errors

* Compat with snyk

* Fix jest resolutions

* Add another esm package

* Fix aliases and next js missing deps

* Update next js embed tests

* Try fix embed test config

* Fix

* Fix requires in e2e support

* Use bun not yarn in embed bin

* Revert config changes

* Use bun in more scripts and use prepare-release action

* Replace more yarn usages

* Remove overrides from bunfig move to package json

* Revert e2e support changes

* Add back comment

* [ci skip] comment typo

* Update bun lock

* Update to reference bun

* Update to reference bun

* Update license disclaimer

* Tidy tests

* Update to use bun in workflows

* Change aliases

* Update codemirrort selector

* Tidy license generation

* Remove .only

* Fix yarn references

* Checkout .github for release scripts

* Update lockfile

* Re-add package

* update release bunlock

* fix checkout check

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2026-02-10 16:27:57 +00:00

88 lines
3.1 KiB
YAML

name: Automatically set milestone
run-name: Set milestone for ${{ github.event.head_commit.message || inputs.version }}
on:
push:
branches:
- release-x.**
workflow_dispatch:
inputs:
version:
description: 'Major version number (e.g. 52, 78, 109)'
type: number
required: true
jobs:
set-milestone:
name: Automatically set milestone
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
isNewReleaseBranch: ${{ github.event_name == 'workflow_dispatch' }}
permissions:
pull-requests: write
issues: write
contents: read
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
release
.github
fetch-depth: ${{ env.isNewReleaseBranch == 'false' && 3 || 0 }} # we need the full history to get all the commit messages
ref: master # we want the logic from master, even though we're triggering on a release branch
- name: Prepare release scripts
uses: ./.github/actions/prepare-release-scripts
- uses: actions/github-script@v7
if: ${{ env.isNewReleaseBranch == 'false' }}
name: Set milestone for single commit
with:
script: | # js
const { setMilestoneForCommits } = require('${{ github.workspace }}/release/dist/index.cjs');
const owner = context.repo.owner;
const repo = context.repo.repo;
const branchName = `${{ github.ref }}`;
const commitMessage = context?.payload?.head_commit?.message ?? '';
await setMilestoneForCommits({
github,
owner,
repo,
branchName,
commitMessages: [commitMessage],
});
- name: Get commit messages for release branch
if: ${{ env.isNewReleaseBranch == 'true' }}
run: |
npm i -g tsx
tsx release/src/release-branch-commits.ts ${{ inputs.version }} > commit-messages.json
- uses: actions/github-script@v7
if: ${{ env.isNewReleaseBranch == 'true' }}
name: Set milestones for new release branch
env:
# this token has a higher rate limit than the default token, and
# we will need it for this workflow to work
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
with:
script: | # js
const { setMilestoneForCommits } = require('${{ github.workspace }}/release/dist/index.cjs');
const commitMessages = require('${{ github.workspace }}/commit-messages.json');
const owner = context.repo.owner;
const repo = context.repo.repo;
const versionNumber = context.payload.inputs.version;
const branchName = `release-x.${versionNumber}.x`;
console.log(`Found ${commitMessages.length} new commits for ${branchName}`);
await setMilestoneForCommits({
github,
owner,
repo,
branchName,
commitMessages: commitMessages,
ignoreExistingMilestones: true,
});