Compare commits

...
Author SHA1 Message Date
Mateusz Burzyński 6da688107f Pin Node.js to 24.22.1 2026-10-23 08:41:24 +02:00
dependabot[bot]andbluwy 615034bb14 Bump zizmorcore/zizmor-action from 0.6.2 to 0.6.4 in the github-actions group (#743)
* Bump zizmorcore/zizmor-action

Bumps the github-actions group with 1 update: [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `zizmorcore/zizmor-action` from 0.6.2 to 0.6.4
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/3dc1ecc9bcb9e94e9b2c709687979e1298497054...cc914d7f3750a2d13d75c7f184a1060aa0e9d482)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix zizmor lints

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2026-10-02 06:17:23 +00:00
dependabot[bot] 8380fc6a4d Bump typescript from 6.0.3 to 7.0.2 (#742)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 6.0.3 to 7.0.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](https://github.com/microsoft/TypeScript/compare/v6.0.3...v7.0.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 7.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 10:06:33 +00:00
dependabot[bot] e912ac334c Bump vitest from 4.1.11 to 5.0.1 (#741)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 4.1.11 to 5.0.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.0.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-version: 5.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 09:43:08 +00:00
dependabot[bot] f01916801c Bump the production-dependencies group across 1 directory with 5 updates (#739)
Bumps the production-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@changesets/get-release-plan](https://github.com/changesets/changesets/tree/HEAD/packages/get-release-plan) | `5.0.0` | `5.0.2` |
| [@changesets/git](https://github.com/changesets/changesets/tree/HEAD/packages/git) | `4.0.0` | `4.0.1` |
| [@changesets/read](https://github.com/changesets/changesets/tree/HEAD/packages/read) | `1.0.0` | `1.0.1` |
| [@octokit/core](https://github.com/octokit/core.js) | `7.0.7` | `7.0.8` |
| [tinyexec](https://github.com/tinylibs/tinyexec) | `1.3.0` | `1.3.1` |



Updates `@changesets/get-release-plan` from 5.0.0 to 5.0.2
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/get-release-plan/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/get-release-plan@5.0.2/packages/get-release-plan)

Updates `@changesets/git` from 4.0.0 to 4.0.1
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/git/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/git@4.0.1/packages/git)

Updates `@changesets/read` from 1.0.0 to 1.0.1
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/read/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/read@1.0.1/packages/read)

Updates `@octokit/core` from 7.0.7 to 7.0.8
- [Release notes](https://github.com/octokit/core.js/releases)
- [Commits](https://github.com/octokit/core.js/compare/v7.0.7...v7.0.8)

Updates `tinyexec` from 1.3.0 to 1.3.1
- [Release notes](https://github.com/tinylibs/tinyexec/releases)
- [Commits](https://github.com/tinylibs/tinyexec/compare/1.3.0...1.3.1)

---
updated-dependencies:
- dependency-name: "@changesets/get-release-plan"
  dependency-version: 5.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@changesets/git"
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@changesets/read"
  dependency-version: 1.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@octokit/core"
  dependency-version: 7.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: tinyexec
  dependency-version: 1.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 09:35:16 +00:00
dependabot[bot] a4133a0d28 Bump the development-dependencies group with 7 updates (#740)
Bumps the development-dependencies group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [@changesets/changelog-github](https://github.com/changesets/changesets/tree/HEAD/packages/changelog-github) | `1.0.0` | `1.0.1` |
| [@changesets/cli](https://github.com/changesets/changesets/tree/HEAD/packages/cli) | `3.0.1` | `3.0.3` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.3.0` | `26.6.2` |
| [fs-fixture](https://github.com/privatenumber/fs-fixture) | `2.14.0` | `2.16.0` |
| [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) | `0.65.0` | `0.70.0` |
| [rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown) | `1.2.5` | `1.2.10` |
| [yaml](https://github.com/eemeli/yaml) | `2.9.0` | `2.9.1` |


Updates `@changesets/changelog-github` from 1.0.0 to 1.0.1
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/changelog-github/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/changelog-github@1.0.1/packages/changelog-github)

Updates `@changesets/cli` from 3.0.1 to 3.0.3
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/cli/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/cli@3.0.3/packages/cli)

Updates `@types/node` from 26.3.0 to 26.6.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `fs-fixture` from 2.14.0 to 2.16.0
- [Release notes](https://github.com/privatenumber/fs-fixture/releases)
- [Commits](https://github.com/privatenumber/fs-fixture/compare/v2.14.0...v2.16.0)

Updates `oxfmt` from 0.65.0 to 0.70.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.70.0/npm/oxfmt)

Updates `rolldown` from 1.2.5 to 1.2.10
- [Release notes](https://github.com/rolldown/rolldown/releases)
- [Changelog](https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rolldown/rolldown/commits/v1.2.10/packages/rolldown)

Updates `yaml` from 2.9.0 to 2.9.1
- [Release notes](https://github.com/eemeli/yaml/releases)
- [Commits](https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: "@changesets/changelog-github"
  dependency-version: 1.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@changesets/cli"
  dependency-version: 3.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@types/node"
  dependency-version: 26.6.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: fs-fixture
  dependency-version: 2.16.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: oxfmt
  dependency-version: 0.70.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: rolldown
  dependency-version: 1.2.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: yaml
  dependency-version: 2.9.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 09:17:49 +00:00
changesets-org-version-bot[bot] 0138f456ec Version Packages (#726)
Co-authored-by: changesets-org-version-bot[bot] <288406890+changesets-org-version-bot[bot]@users.noreply.github.com>
2026-09-07 11:50:58 +00:00
Bjorn Lu 88338839e3 Handle error when pushing git tags with the git CLI (#735)
* Handle error when pushing git tags with the git CLI

* Update message
2026-09-07 11:45:47 +00:00
Bjorn Lu e08fde7435 Improve log messages (#730) 2026-09-04 18:07:20 +00:00
dependabot[bot] 371fd77b45 Bump human-id in the production-dependencies group across 1 directory (#732)
Bumps the production-dependencies group with 1 update in the / directory: [human-id](https://github.com/RienNeVaPlus/human-id).


Updates `human-id` from 4.2.0 to 4.2.1
- [Commits](https://github.com/RienNeVaPlus/human-id/commits)

---
updated-dependencies:
- dependency-name: human-id
  dependency-version: 4.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-01 06:34:13 +00:00
dependabot[bot] 85efcafd80 Bump actions/checkout in the github-actions group across 1 directory (#734)
Bumps the github-actions group with 1 update in the / directory: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.3 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...3d3c42e5aac5ba805825da76410c181273ba90b1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-01 06:18:01 +00:00
dependabot[bot] 5bb9d5ccac Bump the development-dependencies group across 1 directory with 7 updates (#733)
Bumps the development-dependencies group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@changesets/cli](https://github.com/changesets/changesets/tree/HEAD/packages/cli) | `3.0.0` | `3.0.1` |
| [@changesets/write](https://github.com/changesets/changesets/tree/HEAD/packages/write) | `1.0.0` | `1.0.1` |
| [@tsconfig/node24](https://github.com/tsconfig/bases/tree/HEAD/bases) | `24.0.4` | `24.0.5` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.1.2` | `26.3.0` |
| [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) | `0.61.0` | `0.65.0` |
| [rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown) | `1.2.2` | `1.2.5` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `4.1.10` | `4.1.11` |



Updates `@changesets/cli` from 3.0.0 to 3.0.1
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/cli/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/cli@3.0.1/packages/cli)

Updates `@changesets/write` from 1.0.0 to 1.0.1
- [Release notes](https://github.com/changesets/changesets/releases)
- [Changelog](https://github.com/changesets/changesets/blob/main/packages/write/CHANGELOG.md)
- [Commits](https://github.com/changesets/changesets/commits/@changesets/write@1.0.1/packages/write)

Updates `@tsconfig/node24` from 24.0.4 to 24.0.5
- [Commits](https://github.com/tsconfig/bases/commits/HEAD/bases)

Updates `@types/node` from 26.1.2 to 26.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `oxfmt` from 0.61.0 to 0.65.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.65.0/npm/oxfmt)

Updates `rolldown` from 1.2.2 to 1.2.5
- [Release notes](https://github.com/rolldown/rolldown/releases)
- [Changelog](https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rolldown/rolldown/commits/v1.2.5/packages/rolldown)

Updates `vitest` from 4.1.10 to 4.1.11
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.11/packages/vitest)

---
updated-dependencies:
- dependency-name: "@changesets/cli"
  dependency-version: 3.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@changesets/write"
  dependency-version: 1.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@tsconfig/node24"
  dependency-version: 24.0.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@types/node"
  dependency-version: 26.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: oxfmt
  dependency-version: 0.65.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: rolldown
  dependency-version: 1.2.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: vitest
  dependency-version: 4.1.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-01 06:17:16 +00:00
Bjorn Lu ca8589735a Always prepare branch for version (#729)
* Always prepare branch for version

* Update test
2026-08-31 08:18:49 +00:00
Bjorn Lu 36f529f13a Fix root action double error logs (#724) 2026-08-22 10:32:21 +00:00
10 changed files with 725 additions and 486 deletions
+2 -2
View File
@@ -27,12 +27,12 @@ jobs:
security-events: write # allow writing security events security-events: write # allow writing security events
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
persist-credentials: false persist-credentials: false
- name: Run zizmor - name: Run zizmor
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
with: with:
persona: pedantic persona: pedantic
annotations: true annotations: true
+3 -3
View File
@@ -33,7 +33,7 @@ jobs:
- name: Select mode - name: Select mode
id: select-mode id: select-mode
uses: ./select-mode uses: $/select-mode
version: version:
name: Version name: Version
@@ -62,7 +62,7 @@ jobs:
- name: Create or update release pull request - name: Create or update release pull request
id: changesets id: changesets
uses: ./version uses: $/version
with: with:
github-token: ${{ steps.bot-auth.outputs.token }} github-token: ${{ steps.bot-auth.outputs.token }}
script: pnpm bump script: pnpm bump
@@ -92,7 +92,7 @@ jobs:
permission-contents: write # to bypass branch and tag protection rules (release.ts) permission-contents: write # to bypass branch and tag protection rules (release.ts)
- name: Publish to marketplace - name: Publish to marketplace
uses: ./publish uses: $/publish
with: with:
github-token: ${{ steps.bot-auth.outputs.token }} github-token: ${{ steps.bot-auth.outputs.token }}
script: pnpm release script: pnpm release
+1 -1
View File
@@ -1 +1 @@
v24.11.0 24.22.1
+12
View File
@@ -1,5 +1,17 @@
# @changesets/action # @changesets/action
## 2.1.2
### Patch Changes
- [#735](https://github.com/changesets/action/pull/735) [`8833883`](https://github.com/changesets/action/commit/88338839e35c3e0fa61f3c9c3f27e7572cd5f2cf) Thanks [@bluwy](https://github.com/bluwy)! - Handle error when pushing git tags with the git CLI
- [#724](https://github.com/changesets/action/pull/724) [`36f529f`](https://github.com/changesets/action/commit/36f529f13ab58bbcf6331035cb950385586e8a89) Thanks [@bluwy](https://github.com/bluwy)! - Improve log messages
- [#724](https://github.com/changesets/action/pull/724) [`36f529f`](https://github.com/changesets/action/commit/36f529f13ab58bbcf6331035cb950385586e8a89) Thanks [@bluwy](https://github.com/bluwy)! - Fix root action double error logs
- [#729](https://github.com/changesets/action/pull/729) [`ca85897`](https://github.com/changesets/action/commit/ca8589735af2ff6977a0f6474537d550040530d8) Thanks [@bluwy](https://github.com/bluwy)! - Always switch and reset branch when generating version commits, similar to if `push-with-git-cli` is enabled
## 2.1.1 ## 2.1.1
### Patch Changes ### Patch Changes
+18 -18
View File
@@ -1,6 +1,6 @@
{ {
"name": "@changesets/action", "name": "@changesets/action",
"version": "2.1.1", "version": "2.1.2",
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
@@ -23,33 +23,33 @@
"@actions/core": "^3.0.1", "@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0", "@actions/exec": "^3.0.0",
"@actions/github": "^9.1.1", "@actions/github": "^9.1.1",
"@changesets/get-release-plan": "^5.0.0", "@changesets/get-release-plan": "^5.0.2",
"@changesets/ghcommit": "^3.0.0", "@changesets/ghcommit": "^3.0.0",
"@changesets/git": "^4.0.0", "@changesets/git": "^4.0.1",
"@changesets/pre": "^3.0.0", "@changesets/pre": "^3.0.0",
"@changesets/read": "^1.0.0", "@changesets/read": "^1.0.1",
"@manypkg/get-packages": "^3.1.0", "@manypkg/get-packages": "^3.1.0",
"@octokit/core": "^7.0.7", "@octokit/core": "^7.0.8",
"@octokit/plugin-throttling": "^11.0.5", "@octokit/plugin-throttling": "^11.0.5",
"human-id": "^4.2.0", "human-id": "^4.2.1",
"markdown-table": "^3.0.4", "markdown-table": "^3.0.4",
"semver": "^7.8.5", "semver": "^7.8.5",
"tinyexec": "^1.3.0" "tinyexec": "^1.3.1"
}, },
"devDependencies": { "devDependencies": {
"@changesets/changelog-github": "^1.0.0", "@changesets/changelog-github": "^1.0.1",
"@changesets/cli": "^3.0.0", "@changesets/cli": "^3.0.3",
"@changesets/types": "^7.0.0", "@changesets/types": "^7.0.0",
"@changesets/write": "^1.0.0", "@changesets/write": "^1.0.1",
"@tsconfig/node24": "^24.0.4", "@tsconfig/node24": "^24.0.5",
"@types/node": "^26.1.2", "@types/node": "^26.6.2",
"@types/semver": "^7.8.0", "@types/semver": "^7.8.0",
"fs-fixture": "^2.14.0", "fs-fixture": "^2.16.0",
"oxfmt": "^0.61.0", "oxfmt": "^0.70.0",
"rolldown": "^1.2.2", "rolldown": "^1.2.10",
"typescript": "^6.0.3", "typescript": "^7.0.2",
"vitest": "^4.1.10", "vitest": "^5.0.1",
"yaml": "^2.9.0" "yaml": "^2.9.1"
}, },
"engines": { "engines": {
"node": ">=24" "node": ">=24"
+635 -422
View File
File diff suppressed because it is too large Load Diff
+10 -12
View File
@@ -195,7 +195,7 @@ export class GitHub {
if (authorIdentity.exitCode === 0 && committerIdentity.exitCode === 0) { if (authorIdentity.exitCode === 0 && committerIdentity.exitCode === 0) {
return; return;
} }
core.info("Setting Git user to github-actions[bot]"); core.info("Setting git user to github-actions[bot]");
await exec("git", ["config", "user.name", `"github-actions[bot]"`], { await exec("git", ["config", "user.name", `"github-actions[bot]"`], {
cwd: this.cwd, cwd: this.cwd,
}); });
@@ -213,18 +213,14 @@ export class GitHub {
} }
async pushTag(tag: string) { async pushTag(tag: string) {
try {
if (!this.pushWithGitCli) { if (!this.pushWithGitCli) {
return this.octokit.rest.git await this.octokit.rest.git.createRef({
.createRef({
...context.repo, ...context.repo,
ref: `refs/tags/${tag}`, ref: `refs/tags/${tag}`,
sha: context.sha, sha: context.sha,
})
.catch((err) => {
// Assuming tag was manually pushed in custom publish script
core.warning(`Failed to create tag ${tag}: ${err.message}`);
}); });
} } else {
await exec("git", ["push", "origin", tag], { await exec("git", ["push", "origin", tag], {
cwd: this.cwd, cwd: this.cwd,
env: { env: {
@@ -233,12 +229,14 @@ export class GitHub {
} as Record<string, string>, } as Record<string, string>,
}); });
} }
} catch (err) {
core.warning(
`Failed to create git tag "${tag}". Assuming it was manually pushed by the publish script: ${(err as Error).message}`,
);
}
}
async prepareBranch(branch: string) { async prepareBranch(branch: string) {
if (!this.pushWithGitCli) {
// Preparing a new local branch is not necessary when using the API
return;
}
await switchToMaybeExistingBranch(branch, { cwd: this.cwd }); await switchToMaybeExistingBranch(branch, { cwd: this.cwd });
await reset(context.sha, { cwd: this.cwd }); await reset(context.sha, { cwd: this.cwd });
} }
+11 -9
View File
@@ -10,7 +10,13 @@ import {
validateChangesetsCliVersion, validateChangesetsCliVersion,
} from "./utils.ts"; } from "./utils.ts";
(async () => { try {
await main();
} catch (err) {
core.setFailed((err as Error).message);
}
async function main() {
const cwd = getOptionalInput("cwd") || process.cwd(); const cwd = getOptionalInput("cwd") || process.cwd();
await validateChangesetsCliVersion(cwd); await validateChangesetsCliVersion(cwd);
@@ -62,7 +68,7 @@ import {
switch (true) { switch (true) {
case !hasChangesets && !hasPublishScript: case !hasChangesets && !hasPublishScript:
core.info( core.info(
"No changesets present or were removed by merging release PR. Not publishing because no publish script found.", "No changesets present or were removed by merging version PR. Not publishing because publish-script is not set.",
); );
return; return;
case !hasChangesets && hasPublishScript: { case !hasChangesets && hasPublishScript: {
@@ -98,7 +104,7 @@ import {
} }
if (result.exitCode !== 0) { if (result.exitCode !== 0) {
core.error( throw new Error(
`Publish command exited with code ${result.exitCode}${ `Publish command exited with code ${result.exitCode}${
result.published result.published
? `, but some packages were published: ${result.publishedPackages ? `, but some packages were published: ${result.publishedPackages
@@ -107,12 +113,11 @@ import {
: "" : ""
}`, }`,
); );
process.exit(result.exitCode);
} }
return; return;
} }
case hasChangesets && !hasNonEmptyChangesets: case hasChangesets && !hasNonEmptyChangesets:
core.info("All changesets are empty; not creating PR"); core.info("All changesets are empty. Not creating PR");
return; return;
case hasChangesets: { case hasChangesets: {
const { pullRequestNumber } = await runVersion({ const { pullRequestNumber } = await runVersion({
@@ -131,7 +136,4 @@ import {
return; return;
} }
} }
})().catch((err) => { }
core.error(err);
core.setFailed(err.message);
});
+23 -9
View File
@@ -1,12 +1,13 @@
import path from "node:path"; import path from "node:path";
import * as core from "@actions/core"; import * as core from "@actions/core";
import * as github from "@actions/github";
import type { Changeset } from "@changesets/types"; import type { Changeset } from "@changesets/types";
import { writeChangeset } from "@changesets/write"; import { writeChangeset } from "@changesets/write";
import { createFixture } from "fs-fixture";
import { exec } from "tinyexec"; import { exec } from "tinyexec";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { GitHub } from "./github.ts"; import { GitHub } from "./github.ts";
import { runPublish, runVersion } from "./run.ts"; import { runPublish, runVersion } from "./run.ts";
import { gitdir } from "./test-utils.ts";
vi.mock("@actions/github", () => ({ vi.mock("@actions/github", () => ({
context: { context: {
@@ -44,7 +45,7 @@ let mockedGraphql = vi.fn();
const nodeModulesDir = path.join(import.meta.dirname, "..", "node_modules"); const nodeModulesDir = path.join(import.meta.dirname, "..", "node_modules");
function createSimpleProjectFixture() { function createSimpleProjectFixture() {
return createFixture({ return gitdir({
node_modules: (api) => api.symlink(nodeModulesDir), node_modules: (api) => api.symlink(nodeModulesDir),
".changeset/config.json": JSON.stringify({}), ".changeset/config.json": JSON.stringify({}),
"packages/pkg-a/package.json": JSON.stringify({ "packages/pkg-a/package.json": JSON.stringify({
@@ -69,7 +70,7 @@ function createSimpleProjectFixture() {
} }
function createIgnoredPackageFixture() { function createIgnoredPackageFixture() {
return createFixture({ return gitdir({
node_modules: (api) => api.symlink(nodeModulesDir), node_modules: (api) => api.symlink(nodeModulesDir),
".changeset/config.json": JSON.stringify({ ".changeset/config.json": JSON.stringify({
ignore: ["changesets-dev-ignored-package-pkg-a"], ignore: ["changesets-dev-ignored-package-pkg-a"],
@@ -106,15 +107,20 @@ const createGithub = (cwd: string) =>
pushWithGitCli: false, pushWithGitCli: false,
}); });
async function initializeGitRepository(cwd: string) { async function updateGithubContext(cwd: string) {
await exec("git", ["init"], { const head = await exec("git", ["rev-parse", "HEAD"], {
nodeOptions: { cwd }, nodeOptions: { cwd },
throwOnError: true,
}); });
github.context.sha = head.stdout.trim();
}
function resetGithubContext() {
github.context.sha = "xeac7";
} }
beforeEach(() => { beforeEach(() => {
vi.clearAllMocks(); vi.clearAllMocks();
resetGithubContext();
}); });
afterEach(() => { afterEach(() => {
@@ -125,7 +131,7 @@ describe("publish", () => {
it("warns when a custom publish script does not create the output file", async () => { it("warns when a custom publish script does not create the output file", async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await initializeGitRepository(cwd); await updateGithubContext(cwd);
vi.stubEnv("RUNNER_TEMP", cwd); vi.stubEnv("RUNNER_TEMP", cwd);
const result = await runPublish({ const result = await runPublish({
@@ -145,7 +151,7 @@ describe("publish", () => {
}); });
it("throws when the built-in publish command does not create the output file", async () => { it("throws when the built-in publish command does not create the output file", async () => {
await using fixture = await createFixture({ await using fixture = await gitdir({
"node_modules/@changesets/cli/package.json": JSON.stringify({ "node_modules/@changesets/cli/package.json": JSON.stringify({
name: "@changesets/cli", name: "@changesets/cli",
type: "module", type: "module",
@@ -158,7 +164,7 @@ describe("publish", () => {
"package-lock.json": "", "package-lock.json": "",
}); });
const cwd = fixture.path; const cwd = fixture.path;
await initializeGitRepository(cwd); await updateGithubContext(cwd);
vi.stubEnv("RUNNER_TEMP", cwd); vi.stubEnv("RUNNER_TEMP", cwd);
await expect( await expect(
@@ -176,6 +182,7 @@ describe("version", () => {
it("creates simple PR", async () => { it("creates simple PR", async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -213,6 +220,7 @@ describe("version", () => {
it('creates a draft PR when prDraft is "create"', async () => { it('creates a draft PR when prDraft is "create"', async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -247,6 +255,7 @@ describe("version", () => {
it("only includes bumped packages in the PR body", async () => { it("only includes bumped packages in the PR body", async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -280,6 +289,7 @@ describe("version", () => {
it("doesn't include ignored package that got a dependency update in the PR body", async () => { it("doesn't include ignored package that got a dependency update in the PR body", async () => {
await using fixture = await createIgnoredPackageFixture(); await using fixture = await createIgnoredPackageFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -313,6 +323,7 @@ describe("version", () => {
it("does not include changelog entries if full message exceeds size limit", async () => { it("does not include changelog entries if full message exceeds size limit", async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -370,6 +381,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
it("does not include any release information if a message with simplified release info exceeds size limit", async () => { it("does not include any release information if a message with simplified release info exceeds size limit", async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] })); mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -427,6 +439,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
it('updates an existing PR via GraphQL without converting it to draft when prDraft is "create"', async () => { it('updates an existing PR via GraphQL without converting it to draft when prDraft is "create"', async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({
data: [{ number: 123, node_id: "PR_kwDOA" }], data: [{ number: 123, node_id: "PR_kwDOA" }],
@@ -459,6 +472,7 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
it('updates an existing PR via GraphQL and converts it to draft when prDraft is "always"', async () => { it('updates an existing PR via GraphQL and converts it to draft when prDraft is "always"', async () => {
await using fixture = await createSimpleProjectFixture(); await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path; const cwd = fixture.path;
await updateGithubContext(cwd);
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({
data: [{ number: 123, node_id: "PR_kwDOA" }], data: [{ number: 123, node_id: "PR_kwDOA" }],
+3 -3
View File
@@ -401,7 +401,7 @@ export async function runVersion({
head: `${context.repo.owner}:${versionBranch}`, head: `${context.repo.owner}:${versionBranch}`,
base: branch, base: branch,
}); });
core.info( core.debug(
`Existing pull requests: ${JSON.stringify( `Existing pull requests: ${JSON.stringify(
existingPullRequests.data, existingPullRequests.data,
null, null,
@@ -427,7 +427,7 @@ export async function runVersion({
}); });
if (existingPullRequests.data.length === 0) { if (existingPullRequests.data.length === 0) {
core.info("creating pull request"); core.info("Creating pull request");
const { data: newPullRequest } = await octokit.rest.pulls.create({ const { data: newPullRequest } = await octokit.rest.pulls.create({
base: branch, base: branch,
head: versionBranch, head: versionBranch,
@@ -443,7 +443,7 @@ export async function runVersion({
} else { } else {
const [pullRequest] = existingPullRequests.data; const [pullRequest] = existingPullRequests.data;
core.info(`updating found pull request #${pullRequest.number}`); core.info(`Updating found pull request #${pullRequest.number}`);
const convertPullRequestToDraftMutation = const convertPullRequestToDraftMutation =
prDraft === "always" prDraft === "always"
? ` ? `