Compare commits

..
Author SHA1 Message Date
dependabot[bot] b7e12f4cd1 build(deps-dev): bump cross-spawn from 7.0.6 to 7.1.2 (#4546)
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.6 to 7.1.2.
- [Release notes](https://github.com/moxystudio/node-cross-spawn/releases)
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.6...v7.1.2)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-version: 7.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-12-01 13:08:45 +00:00
dependabot[bot] 658c0d3724 build(deps): bump peter-evans/create-pull-request (#4540)
Bumps the github-actions group with 1 update: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request).


Updates `peter-evans/create-pull-request` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/5f6978faf089d4d20b00c7766989d076bb2fc7f1...3ffccacd46053766916f087ce41d627c0b8cf2d1)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-version: 8.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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-12-01 13:04:22 +00:00
dependabot[bot] 2261dc5d77 build(deps-dev): bump prettier from 3.9.10 to 3.10.1 in the npm group (#4541)
Bumps the npm group with 1 update: [prettier](https://github.com/prettier/prettier).


Updates `prettier` from 3.9.10 to 3.10.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.10...3.10.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.10.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-12-01 13:04:19 +00:00
Peter EvansandCopilot App b457f7bfef ci: harden update-major-version workflow inputs (#4535)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-24 09:10:03 +00:00
actions-botandpeter-evans 3ffccacd46 build: update distribution (#4526)
Co-authored-by: peter-evans <18365890+peter-evans@users.noreply.github.com>
2026-11-10 12:50:36 +00:00
77d56500d9 fix: check git ref directly when pushing signed commits (#4521)
The branches API follows branch rename redirects, so a branch name that was
previously renamed resolves to the renamed branch. This caused the ref to be
reported as existing, and the subsequent updateRef failed with 'Reference does
not exist'. Check the git ref directly instead, which is the same ref that is
then created or updated.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-10 12:44:19 +00:00
Finn Evers 15733dbdfe fix: submodule deletion with sign-commits (#4473)
* Fix submodule deletion with `sign-commits`

* Unstale the staleness
2026-11-06 11:14:42 +00:00
dependabot[bot] 3afad46a91 build(deps-dev): bump the npm group with 4 updates (#4509)
Bumps the npm group with 4 updates: [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), [js-yaml](https://github.com/nodeca/js-yaml), [prettier](https://github.com/prettier/prettier) and [ts-jest](https://github.com/kulshekhar/ts-jest).


Updates `eslint-plugin-prettier` from 5.5.6 to 5.5.7
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.6...v5.5.7)

Updates `js-yaml` from 5.4.2 to 5.5.0
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.4.2...5.5.0)

Updates `prettier` from 3.9.9 to 3.9.10
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.9...3.9.10)

Updates `ts-jest` from 29.4.14 to 29.4.15
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.14...v29.4.15)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.5.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: js-yaml
  dependency-version: 5.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.9.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: ts-jest
  dependency-version: 29.4.15
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-01 12:36:09 +00:00
dependabot[bot] aee70bea9c build(deps): bump the github-actions group with 3 updates (#4510)
Bumps the github-actions group with 3 updates: [actions/setup-node](https://github.com/actions/setup-node), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1)

Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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-11-01 12:35:46 +00:00
dependabot[bot] 86c87cfdd8 build(deps-dev): bump undici from 6.29.0 to 6.29.1 (#4504)
Bumps [undici](https://github.com/nodejs/undici) from 6.29.0 to 6.29.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.29.0...v6.29.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.29.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-30 02:11:20 +00:00
dependabot[bot] bd09a93810 build(deps-dev): bump handlebars from 4.7.9 to 4.7.10 (#4494)
Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.9 to 4.7.10.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.10/release-notes.md)
- [Commits](https://github.com/handlebars-lang/handlebars.js/compare/v4.7.9...v4.7.10)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-version: 4.7.10
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-12 11:14:58 +00:00
dependabot[bot] 59910dc448 build(deps): bump brace-expansion (#4486)
Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 1.1.18 to 1.1.21
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v1.1.21)

Updates `brace-expansion` from 2.1.4 to 2.1.7
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v1.1.21)

Updates `brace-expansion` from 5.0.9 to 5.0.12
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v1.1.21)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.21
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.7
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 5.0.12
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 12:45:55 +00:00
dependabot[bot] 753b4376e5 build(deps-dev): bump the npm group with 4 updates (#4483)
Bumps the npm group with 4 updates: [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest), [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom), [prettier](https://github.com/prettier/prettier) and [ts-jest](https://github.com/kulshekhar/ts-jest).


Updates `jest` from 30.5.0 to 30.5.2
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.5.2/packages/jest)

Updates `jest-environment-jsdom` from 30.5.0 to 30.5.2
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.5.2/packages/jest-environment-jsdom)

Updates `prettier` from 3.9.6 to 3.9.9
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.6...3.9.9)

Updates `ts-jest` from 29.4.12 to 29.4.14
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.12...v29.4.14)

---
updated-dependencies:
- dependency-name: jest
  dependency-version: 30.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: jest-environment-jsdom
  dependency-version: 30.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.9.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: ts-jest
  dependency-version: 29.4.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 12:41:22 +00:00
dependabot[bot] abadea5d94 build(deps-dev): bump undici from 6.28.0 to 6.29.0 (#4478)
Bumps [undici](https://github.com/nodejs/undici) from 6.28.0 to 6.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.28.0...v6.29.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.29.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-29 22:07:44 +00:00
dependabot[bot] 11e8dc7c9c build(deps-dev): bump js-yaml from 4.2.0 to 5.4.2 (#4468)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 5.4.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.2.0...5.4.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-13 16:25:18 +00:00
dependabot[bot] c9f8b51aaa build(deps-dev): bump browserslist from 4.28.4 to 4.28.8 (#4462)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.4 to 4.28.8.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.28.4...4.28.8)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-03 00:39:49 +00:00
actions-bot 1a3c7ab17d build: update distribution (#4457) 2026-09-02 09:27:43 +01:00
dependabot[bot] 762a4a5ab1 build(deps-dev): bump the npm group with 4 updates (#4452)
Bumps the npm group with 4 updates: [@vercel/ncc](https://github.com/vercel/ncc), [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest), [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom) and [js-yaml](https://github.com/nodeca/js-yaml).


Updates `@vercel/ncc` from 0.44.1 to 0.45.0
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.44.1...0.45.0)

Updates `jest` from 30.4.2 to 30.5.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.5.0/packages/jest)

Updates `jest-environment-jsdom` from 30.4.1 to 30.5.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.5.0/packages/jest-environment-jsdom)

Updates `js-yaml` from 5.2.2 to 5.4.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.2.2...5.4.1)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.45.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: jest
  dependency-version: 30.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: jest-environment-jsdom
  dependency-version: 30.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: js-yaml
  dependency-version: 5.4.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-01 12:35:20 +00:00
dependabot[bot] b99c9ae23b build(deps): bump brace-expansion (#4446)
Bumps  and [brace-expansion](https://github.com/juliangruber/brace-expansion). These dependencies needed to be updated together.

Updates `brace-expansion` from 1.1.12 to 1.1.18
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.18)

Updates `brace-expansion` from 2.0.2 to 2.1.4
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.18)

Updates `brace-expansion` from 2.1.1 to 2.1.4
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.18)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.18
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-20 23:34:05 +00:00
dependabot[bot] 11fa467881 build(deps): bump the github-actions group with 2 updates (#4435)
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-node](https://github.com/actions/setup-node).


Updates `actions/checkout` from 7.0.0 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/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `actions/setup-node` from 6.4.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  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-08-01 12:35:19 +00:00
dependabot[bot] 92f6f0bc90 build(deps-dev): bump the npm group with 4 updates (#4436)
Bumps the npm group with 4 updates: [@vercel/ncc](https://github.com/vercel/ncc), [prettier](https://github.com/prettier/prettier), [ts-jest](https://github.com/kulshekhar/ts-jest) and [undici](https://github.com/nodejs/undici).


Updates `@vercel/ncc` from 0.44.0 to 0.44.1
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.44.0...0.44.1)

Updates `prettier` from 3.9.1 to 3.9.6
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.1...3.9.6)

Updates `ts-jest` from 29.4.11 to 29.4.12
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.11...v29.4.12)

Updates `undici` from 6.27.0 to 6.28.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.27.0...v6.28.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.44.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.9.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: ts-jest
  dependency-version: 29.4.12
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: undici
  dependency-version: 6.28.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-01 12:35:10 +00:00
dependabot[bot] 7ec5aae3c9 build(deps-dev): bump js-yaml from 5.2.1 to 5.2.2 (#4430)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 5.2.1 to 5.2.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.2.1...5.2.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.2.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-28 03:50:11 +00:00
dependabot[bot] c66b8cb005 build(deps-dev): bump js-yaml from 5.2.0 to 5.2.1 (#4423)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 5.2.0 to 5.2.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.2.0...5.2.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.2.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-20 21:35:33 +00:00
dependabot[bot] 653ba8b281 build(deps-dev): bump the npm group with 2 updates (#4418)
Bumps the npm group with 2 updates: [js-yaml](https://github.com/nodeca/js-yaml) and [prettier](https://github.com/prettier/prettier).


Updates `js-yaml` from 5.0.0 to 5.2.0
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.0.0...5.2.0)

Updates `prettier` from 3.8.4 to 3.9.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.4...3.9.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.9.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-01 12:35:18 +00:00
dependabot[bot] 6fff569d74 build(deps): bump actions/checkout in the github-actions group (#4411)
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [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...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  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-06-24 17:24:58 +00:00
Peter Evans a78ae501dd chore: pin actions to commit shas (#4406)
* chore: pin actions to commit shas

* chore: add dependabot cooldown
2026-06-24 18:21:21 +01:00
dependabot[bot] de36595094 build(deps-dev): bump js-yaml from 4.2.0 to 5.0.0 (#4387)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.2.0 to 5.0.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.2.0...5.0.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 13:52:35 +00:00
dependabot[bot] 5f42108561 build(deps-dev): bump undici from 6.25.0 to 6.27.0 (#4386)
Bumps [undici](https://github.com/nodejs/undici) from 6.25.0 to 6.27.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.25.0...v6.27.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.27.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 13:47:47 +00:00
dependabot[bot] 8c5aeef7f4 build(deps-dev): bump the npm group across 1 directory with 7 updates (#4391)
Bumps the npm group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@vercel/ncc](https://github.com/vercel/ncc) | `0.38.4` | `0.44.0` |
| [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) | `5.5.5` | `5.5.6` |
| [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom) | `30.3.0` | `30.4.1` |
| [js-yaml](https://github.com/nodeca/js-yaml) | `4.1.1` | `4.2.0` |
| [prettier](https://github.com/prettier/prettier) | `3.8.3` | `3.8.4` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.4.9` | `29.4.11` |
| [undici](https://github.com/nodejs/undici) | `6.25.0` | `6.27.0` |



Updates `@vercel/ncc` from 0.38.4 to 0.44.0
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.4...0.44.0)

Updates `eslint-plugin-prettier` from 5.5.5 to 5.5.6
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.5...v5.5.6)

Updates `jest-environment-jsdom` from 30.3.0 to 30.4.1
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.4.1/packages/jest-environment-jsdom)

Updates `js-yaml` from 4.1.1 to 4.2.0
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...4.2.0)

Updates `prettier` from 3.8.3 to 3.8.4
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.3...3.8.4)

Updates `ts-jest` from 29.4.9 to 29.4.11
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.9...v29.4.11)

Updates `undici` from 6.25.0 to 6.27.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.25.0...v6.27.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.44.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.5.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: jest-environment-jsdom
  dependency-version: 30.4.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.8.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: ts-jest
  dependency-version: 29.4.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: undici
  dependency-version: 6.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 13:47:46 +00:00
Peter Evans 8b4b9968cb build(deps): update to jest 30 (#4388) 2026-06-24 14:43:06 +01:00
Peter Evans aa523f9db6 refactor: replace uuid dep with Node.js built-in crypto.randomUUID (#4377)
Replace the third-party `uuid` package with the native `crypto.randomUUID()`
function available in Node.js, reducing the bundle size and external
dependencies.

- Remove `uuid` from `dependencies` in `package.json`
- Replace `import {v4 as uuidv4} from 'uuid'` with `import {randomUUID} from 'crypto'` in `src/create-or-update-branch.ts`
- Replace all `uuidv4()` calls with `randomUUID()` in `__test__/create-or-update-branch.int.test.ts`
- Rebuild `dist/index.js`, removing ~680 lines of bundled `uuid` library code
- Update `package-lock.json` to reflect removed dependency
2026-05-06 12:10:34 +01:00
dependabot[bot] d8c15c739f build(deps-dev): bump the npm group with 2 updates (#4372)
Bumps the npm group with 2 updates: [prettier](https://github.com/prettier/prettier) and [undici](https://github.com/nodejs/undici).


Updates `prettier` from 3.8.1 to 3.8.3
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.1...3.8.3)

Updates `undici` from 6.24.1 to 6.25.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.24.1...v6.25.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: undici
  dependency-version: 6.25.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-01 14:37:34 +00:00
actions-botandpeter-evans eec7ab75b2 build: update distribution (#4361)
Co-authored-by: peter-evans <18365890+peter-evans@users.noreply.github.com>
2026-04-10 17:35:29 +01:00
Peter Evans 5f6978faf0 fix: retry post-creation API calls on 422 eventual consistency errors (#4356)
Add retry logic to handle GitHub API eventual consistency errors that
can occur after creating a new pull request. Follow-up API calls for
milestones, labels, assignees, and reviewers may fail with a 422
"Could not resolve to a node" error before the PR is fully propagated.

- Add generic `retryWithBackoff` helper in `src/utils.ts` with
  exponential backoff (default 2 retries, starting at 1s delay)
- Wrap post-creation API calls in `src/github-helper.ts` with
  `withRetryForNewPr()`, which only retries for newly created PRs
- Use `@octokit/request-error` `RequestError` type for precise error
  matching (status 422 + "Could not resolve to a node" message)
- Add unit tests for `retryWithBackoff` covering success, retry,
  exhaustion, and non-retryable error scenarios
- Update `dist/index.js` bundle and `package.json` dependencies
2026-04-10 17:23:55 +01:00
dependabot[bot] d32e88dac7 build(deps-dev): bump the npm group with 3 updates (#4349)
Bumps the npm group with 3 updates: [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom), [ts-jest](https://github.com/kulshekhar/ts-jest) and [undici](https://github.com/nodejs/undici).


Updates `jest-environment-jsdom` from 30.2.0 to 30.3.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.3.0/packages/jest-environment-jsdom)

Updates `ts-jest` from 29.4.6 to 29.4.9
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.6...v29.4.9)

Updates `undici` from 6.24.0 to 6.24.1
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.24.0...v6.24.1)

---
updated-dependencies:
- dependency-name: jest-environment-jsdom
  dependency-version: 30.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: ts-jest
  dependency-version: 29.4.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: undici
  dependency-version: 6.24.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 15:23:34 +00:00
dependabot[bot] 8170bccad1 build(deps-dev): bump handlebars from 4.7.8 to 4.7.9 (#4344)
Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.8 to 4.7.9.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.9/release-notes.md)
- [Commits](https://github.com/handlebars-lang/handlebars.js/compare/v4.7.8...v4.7.9)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-version: 4.7.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 20:17:57 +00:00
dependabot[bot] 00418193b4 build(deps): bump picomatch (#4339)
Bumps  and [picomatch](https://github.com/micromatch/picomatch). These dependencies needed to be updated together.

Updates `picomatch` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

Updates `picomatch` from 4.0.2 to 4.0.4
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

Updates `picomatch` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-25 21:50:05 +00:00
dependabot[bot] b993918c85 build(deps-dev): bump flatted from 3.3.1 to 3.4.2 (#4334)
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.1 to 3.4.2.
- [Commits](https://github.com/WebReflection/flatted/compare/v3.3.1...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-20 00:22:17 +00:00
dependabot[bot] 36d7c8468b build(deps-dev): bump undici from 6.23.0 to 6.24.0 (#4328)
Bumps [undici](https://github.com/nodejs/undici) from 6.23.0 to 6.24.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.23.0...v6.24.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.24.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-14 06:18:43 +00:00
dependabot[bot] a45d1fb447 build(deps): bump @tootallnate/once and jest-environment-jsdom (#4323)
Removes [@tootallnate/once](https://github.com/TooTallNate/once). It's no longer used after updating ancestor dependency [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom). These dependencies need to be updated together.


Removes `@tootallnate/once`

Updates `jest-environment-jsdom` from 29.7.0 to 30.2.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.2.0/packages/jest-environment-jsdom)

---
updated-dependencies:
- dependency-name: "@tootallnate/once"
  dependency-version: 
  dependency-type: indirect
- dependency-name: jest-environment-jsdom
  dependency-version: 30.2.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 06:14:22 +00:00
dependabot[bot] 3499eb6183 build(deps): bump the github-actions group with 2 updates (#4316)
Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

Updates `actions/download-artifact` from 7 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: '8'
  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-03-01 12:34:50 +00:00
dependabot[bot] 3f3b473b8c build(deps): bump minimatch (#4311)
Bumps  and [minimatch](https://github.com/isaacs/minimatch). These dependencies needed to be updated together.

Updates `minimatch` from 3.1.2 to 3.1.5
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

Updates `minimatch` from 9.0.5 to 9.0.9
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
- dependency-name: minimatch
  dependency-version: 9.0.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-28 06:50:02 +00:00
dependabot[bot] 6699836a21 build(deps-dev): bump the npm group with 2 updates (#4305)
Bumps the npm group with 2 updates: [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) and [prettier](https://github.com/prettier/prettier).


Updates `eslint-plugin-prettier` from 5.5.4 to 5.5.5
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.4...v5.5.5)

Updates `prettier` from 3.7.4 to 3.8.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.7.4...3.8.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.5.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.8.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-01 12:35:41 +00:00
20 changed files with 3513 additions and 3031 deletions

No files matched your search

+4
View File
@@ -5,6 +5,8 @@ updates:
schedule: schedule:
interval: "monthly" interval: "monthly"
day: "tuesday" day: "tuesday"
cooldown:
default-days: 3
labels: labels:
- "dependencies" - "dependencies"
groups: groups:
@@ -17,6 +19,8 @@ updates:
schedule: schedule:
interval: "monthly" interval: "monthly"
day: "tuesday" day: "tuesday"
cooldown:
default-days: 3
ignore: ignore:
- dependency-name: "*" - dependency-name: "*"
update-types: ["version-update:semver-major"] update-types: ["version-update:semver-major"]
+1 -1
View File
@@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' if: github.actor == 'dependabot[bot]'
steps: steps:
- uses: peter-evans/enable-pull-request-automerge@v3 - uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
with: with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }} token: ${{ secrets.ACTIONS_BOT_TOKEN }}
pull-request-number: ${{ github.event.pull_request.number }} pull-request-number: ${{ github.event.pull_request.number }}
+13 -13
View File
@@ -19,8 +19,8 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@v6 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with: with:
node-version-file: package.json node-version-file: package.json
cache: npm cache: npm
@@ -29,11 +29,11 @@ jobs:
- run: npm run format-check - run: npm run format-check
- run: npm run lint - run: npm run lint
- run: npm run test - run: npm run test
- uses: actions/upload-artifact@v6 - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: dist name: dist
path: dist path: dist
- uses: actions/upload-artifact@v6 - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: action.yml name: action.yml
path: action.yml path: action.yml
@@ -46,16 +46,16 @@ jobs:
matrix: matrix:
target: [built, committed] target: [built, committed]
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
ref: main ref: main
- if: matrix.target == 'built' || github.event_name == 'pull_request' - if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v7 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with: with:
name: dist name: dist
path: dist path: dist
- if: matrix.target == 'built' || github.event_name == 'pull_request' - if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v7 uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with: with:
name: action.yml name: action.yml
path: . path: .
@@ -80,7 +80,7 @@ jobs:
branch: ci-test-${{ matrix.target }}-${{ github.sha }} branch: ci-test-${{ matrix.target }}-${{ github.sha }}
- name: Close Pull - name: Close Pull
uses: peter-evans/close-pull@v3 uses: peter-evans/close-pull@a192af8d70f2d49c49643134605c3b73d4f80fae # v3.0.1
with: with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
comment: '[CI] test ${{ matrix.target }}' comment: '[CI] test ${{ matrix.target }}'
@@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Find Comment - name: Find Comment
uses: peter-evans/find-comment@v4 uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
id: fc id: fc
with: with:
issue-number: ${{ github.event.number }} issue-number: ${{ github.event.number }}
@@ -101,7 +101,7 @@ jobs:
- if: steps.fc.outputs.comment-id == '' - if: steps.fc.outputs.comment-id == ''
name: Create comment name: Create comment
uses: peter-evans/create-or-update-comment@v5 uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with: with:
issue-number: ${{ github.event.number }} issue-number: ${{ github.event.number }}
body: | body: |
@@ -118,13 +118,13 @@ jobs:
needs: [test] needs: [test]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@v7 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with: with:
name: dist name: dist
path: dist path: dist
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v8 uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
with: with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }} token: ${{ secrets.ACTIONS_BOT_TOKEN }}
commit-message: 'build: update distribution' commit-message: 'build: update distribution'
+2 -2
View File
@@ -6,7 +6,7 @@ jobs:
createPullRequest: createPullRequest:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Make changes to pull request - name: Make changes to pull request
run: date +%s > report.txt run: date +%s > report.txt
@@ -42,7 +42,7 @@ jobs:
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Add reaction - name: Add reaction
uses: peter-evans/create-or-update-comment@v5 uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with: with:
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Slash Command Dispatch - name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v5 uses: peter-evans/slash-command-dispatch@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
with: with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }} token: ${{ secrets.ACTIONS_BOT_TOKEN }}
config: > config: >
+10 -3
View File
@@ -18,7 +18,7 @@ jobs:
tag: tag:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }} token: ${{ secrets.ACTIONS_BOT_TOKEN }}
fetch-depth: 0 fetch-depth: 0
@@ -27,6 +27,13 @@ jobs:
git config user.name actions-bot git config user.name actions-bot
git config user.email actions-bot@users.noreply.github.com git config user.email actions-bot@users.noreply.github.com
- name: Tag new target - name: Tag new target
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }} run: |
sha=$(git rev-parse --verify --end-of-options "${INPUT_TARGET}^{commit}")
git tag -f "${INPUT_MAIN_VERSION}" "${sha}"
env:
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
INPUT_TARGET: ${{ github.event.inputs.target }}
- name: Push new tag - name: Push new tag
run: git push origin ${{ github.event.inputs.main_version }} --force run: git push origin "${INPUT_MAIN_VERSION}" --force
env:
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
+75 -75
View File
@@ -4,10 +4,10 @@ import {
getWorkingBaseAndType, getWorkingBaseAndType,
buildBranchCommits buildBranchCommits
} from '../lib/create-or-update-branch' } from '../lib/create-or-update-branch'
import {randomUUID} from 'crypto'
import * as fs from 'fs' import * as fs from 'fs'
import {GitCommandManager} from '../lib/git-command-manager' import {GitCommandManager} from '../lib/git-command-manager'
import * as path from 'path' import * as path from 'path'
import {v4 as uuidv4} from 'uuid'
const REPO_PATH = '/git/local/repos/test-base' const REPO_PATH = '/git/local/repos/test-base'
const REMOTE_NAME = 'origin' const REMOTE_NAME = 'origin'
@@ -31,7 +31,7 @@ const ADD_PATHS_MULTI = ['a', 'b']
const ADD_PATHS_WILDCARD = ['a/*.txt', 'b/*.txt'] const ADD_PATHS_WILDCARD = ['a/*.txt', 'b/*.txt']
async function createFile(filename: string, content?: string): Promise<string> { async function createFile(filename: string, content?: string): Promise<string> {
const _content = content ? content : uuidv4() const _content = content ? content : randomUUID()
const filepath = path.join(REPO_PATH, filename) const filepath = path.join(REPO_PATH, filename)
await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) await fs.promises.mkdir(path.dirname(filepath), {recursive: true})
await fs.promises.writeFile(filepath, _content, {encoding: 'utf8'}) await fs.promises.writeFile(filepath, _content, {encoding: 'utf8'})
@@ -82,7 +82,7 @@ async function createCommits(
} else { } else {
result.changes = await createChanges() result.changes = await createChanges()
} }
const commitMessage = uuidv4() const commitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', commitMessage]) await git.commit(['-m', commitMessage])
result.commitMsgs.unshift(commitMessage) result.commitMsgs.unshift(commitMessage)
@@ -313,7 +313,7 @@ describe('create-or-update-branch tests', () => {
}) })
it('tests no changes resulting in no new branch being created', async () => { it('tests no changes resulting in no new branch being created', async () => {
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -330,7 +330,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with a tracked file change', async () => { it('tests create and update with a tracked file change', async () => {
// Create a tracked file change // Create a tracked file change
const trackedContent = await createFile(TRACKED_FILE) const trackedContent = await createFile(TRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -359,7 +359,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const _trackedContent = await createFile(TRACKED_FILE) const _trackedContent = await createFile(TRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -381,7 +381,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with an untracked file change', async () => { it('tests create and update with an untracked file change', async () => {
// Create an untracked file change // Create an untracked file change
const untrackedContent = await createFile(UNTRACKED_FILE) const untrackedContent = await createFile(UNTRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -410,7 +410,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const _untrackedContent = await createFile(UNTRACKED_FILE) const _untrackedContent = await createFile(UNTRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -434,7 +434,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -464,7 +464,7 @@ describe('create-or-update-branch tests', () => {
// Create identical tracked and untracked file changes // Create identical tracked and untracked file changes
await createChanges(changes.tracked, changes.untracked) await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -486,7 +486,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with commits on the base inbetween', async () => { it('tests create and update with commits on the base inbetween', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -524,7 +524,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -556,7 +556,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -585,7 +585,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Running with no update effectively reverts the branch back to match the base // Running with no update effectively reverts the branch back to match the base
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -607,7 +607,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -648,7 +648,7 @@ describe('create-or-update-branch tests', () => {
commits.changes.tracked, commits.changes.tracked,
commits.changes.untracked commits.changes.untracked
) )
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -673,7 +673,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -703,7 +703,7 @@ describe('create-or-update-branch tests', () => {
// Create a commit on the base with a partial merge of the changes // Create a commit on the base with a partial merge of the changes
await createFile(TRACKED_FILE, changes.tracked) await createFile(TRACKED_FILE, changes.tracked)
const baseCommitMessage = uuidv4() const baseCommitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', baseCommitMessage]) await git.commit(['-m', baseCommitMessage])
await git.push([ await git.push([
@@ -714,7 +714,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes // Create the same tracked and untracked file changes
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -746,7 +746,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -790,7 +790,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -816,7 +816,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -845,7 +845,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Force push the base branch to a different commit // Force push the base branch to a different commit
const amendedCommitMessage = uuidv4() const amendedCommitMessage = randomUUID()
await git.commit(['--amend', '-m', amendedCommitMessage]) await git.commit(['--amend', '-m', amendedCommitMessage])
await git.push([ await git.push([
'--force', '--force',
@@ -855,7 +855,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -878,7 +878,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with commits on the working base (during the workflow)', async () => { it('tests create and update with commits on the working base (during the workflow)', async () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -910,7 +910,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const _commits = await createCommits(git) const _commits = await createCommits(git)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -937,7 +937,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -973,7 +973,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1002,7 +1002,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1046,7 +1046,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1074,7 +1074,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update using a different remote from the base', async () => { it('tests create and update using a different remote from the base', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1104,7 +1104,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1127,7 +1127,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with signoff on commit', async () => { it('tests create and update with signoff on commit', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1164,7 +1164,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1194,7 +1194,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with multiple add-paths', async () => { it('tests create and update with multiple add-paths', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1224,7 +1224,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1247,7 +1247,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with wildcard add-paths', async () => { it('tests create and update with wildcard add-paths', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1277,7 +1277,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1300,7 +1300,7 @@ describe('create-or-update-branch tests', () => {
it('tests create with add-paths resolving to no changes when other changes exist', async () => { it('tests create with add-paths resolving to no changes when other changes exist', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
await createChanges() await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1321,7 +1321,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const resultA = await createOrUpdateBranch( const resultA = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1365,7 +1365,7 @@ describe('create-or-update-branch tests', () => {
// Set the working base to a branch that is not the pull request base // Set the working base to a branch that is not the pull request base
await git.checkout(NOT_BASE_BRANCH) await git.checkout(NOT_BASE_BRANCH)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1386,7 +1386,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const trackedContent = await createFile(TRACKED_FILE) const trackedContent = await createFile(TRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1418,7 +1418,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const _trackedContent = await createFile(TRACKED_FILE) const _trackedContent = await createFile(TRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1443,7 +1443,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const untrackedContent = await createFile(UNTRACKED_FILE) const untrackedContent = await createFile(UNTRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1475,7 +1475,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const _untrackedContent = await createFile(UNTRACKED_FILE) const _untrackedContent = await createFile(UNTRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1502,7 +1502,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1535,7 +1535,7 @@ describe('create-or-update-branch tests', () => {
// Create identical tracked and untracked file changes // Create identical tracked and untracked file changes
await createChanges(changes.tracked, changes.untracked) await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1560,7 +1560,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1601,7 +1601,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1635,7 +1635,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1667,7 +1667,7 @@ describe('create-or-update-branch tests', () => {
await git.checkout(NOT_BASE_BRANCH) await git.checkout(NOT_BASE_BRANCH)
// Running with no update effectively reverts the branch back to match the base // Running with no update effectively reverts the branch back to match the base
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1694,7 +1694,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1738,7 +1738,7 @@ describe('create-or-update-branch tests', () => {
commits.changes.tracked, commits.changes.tracked,
commits.changes.untracked commits.changes.untracked
) )
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1768,7 +1768,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1798,7 +1798,7 @@ describe('create-or-update-branch tests', () => {
// Create a commit on the base with a partial merge of the changes // Create a commit on the base with a partial merge of the changes
await createFile(TRACKED_FILE, changes.tracked) await createFile(TRACKED_FILE, changes.tracked)
const baseCommitMessage = uuidv4() const baseCommitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', baseCommitMessage]) await git.commit(['-m', baseCommitMessage])
await git.push([ await git.push([
@@ -1812,7 +1812,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes // Create the same tracked and untracked file changes
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1846,7 +1846,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1893,7 +1893,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1924,7 +1924,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1953,7 +1953,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Force push the base branch to a different commit // Force push the base branch to a different commit
const amendedCommitMessage = uuidv4() const amendedCommitMessage = randomUUID()
await git.commit(['--amend', '-m', amendedCommitMessage]) await git.commit(['--amend', '-m', amendedCommitMessage])
await git.push([ await git.push([
'--force', '--force',
@@ -1966,7 +1966,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1992,7 +1992,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2027,7 +2027,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const _commits = await createCommits(git) const _commits = await createCommits(git)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2057,7 +2057,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2096,7 +2096,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2128,7 +2128,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2175,7 +2175,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2205,7 +2205,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2238,7 +2238,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2268,7 +2268,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2302,7 +2302,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2329,7 +2329,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2371,7 +2371,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2403,7 +2403,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2428,7 +2428,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const resultA = await createOrUpdateBranch( const resultA = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
+5 -82
View File
@@ -1,7 +1,5 @@
import {GitCommandManager} from '../lib/git-command-manager' import {GitCommandManager} from '../lib/git-command-manager'
import {GitConfigHelper} from '../lib/git-config-helper' import {GitConfigHelper} from '../lib/git-config-helper'
import * as fs from 'fs'
import * as path from 'path'
const REPO_PATH = '/git/local/repos/test-base' const REPO_PATH = '/git/local/repos/test-base'
@@ -9,104 +7,29 @@ const extraheaderConfigKey = 'http.https://127.0.0.1/.extraheader'
describe('git-config-helper integration tests', () => { describe('git-config-helper integration tests', () => {
let git: GitCommandManager let git: GitCommandManager
let originalRunnerTemp: string | undefined
beforeAll(async () => { beforeAll(async () => {
git = await GitCommandManager.create(REPO_PATH) git = await GitCommandManager.create(REPO_PATH)
}) })
beforeEach(async () => {
// Save original RUNNER_TEMP
originalRunnerTemp = process.env['RUNNER_TEMP']
// Create a temp directory for tests
const tempDir = await fs.promises.mkdtemp('/tmp/cpr-test-')
process.env['RUNNER_TEMP'] = tempDir
process.env['GITHUB_WORKSPACE'] = REPO_PATH
})
afterEach(async () => {
// Clean up RUNNER_TEMP
const runnerTemp = process.env['RUNNER_TEMP']
if (runnerTemp && runnerTemp.startsWith('/tmp/cpr-test-')) {
await fs.promises.rm(runnerTemp, {recursive: true, force: true})
}
// Restore original RUNNER_TEMP
if (originalRunnerTemp !== undefined) {
process.env['RUNNER_TEMP'] = originalRunnerTemp
} else {
delete process.env['RUNNER_TEMP']
}
})
it('tests save and restore with no persisted auth', async () => { it('tests save and restore with no persisted auth', async () => {
const gitConfigHelper = await GitConfigHelper.create(git) const gitConfigHelper = await GitConfigHelper.create(git)
await gitConfigHelper.close() await gitConfigHelper.close()
}) })
it('tests configure and removal of auth using credentials file', async () => { it('tests configure and removal of auth', async () => {
const runnerTemp = process.env['RUNNER_TEMP']!
const gitConfigHelper = await GitConfigHelper.create(git) const gitConfigHelper = await GitConfigHelper.create(git)
await gitConfigHelper.configureToken('github-token') await gitConfigHelper.configureToken('github-token')
expect(await git.configExists(extraheaderConfigKey)).toBeTruthy()
// Verify credentials file was created in RUNNER_TEMP expect(await git.getConfigValue(extraheaderConfigKey)).toEqual(
const files = await fs.promises.readdir(runnerTemp)
const credentialsFiles = files.filter(
f => f.startsWith('git-credentials-') && f.endsWith('.config')
)
expect(credentialsFiles.length).toBe(1)
// Verify credentials file contains the auth token
const credentialsPath = path.join(runnerTemp, credentialsFiles[0])
const credentialsContent = await fs.promises.readFile(
credentialsPath,
'utf8'
)
expect(credentialsContent).toContain(
'AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2l0aHViLXRva2Vu' 'AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2l0aHViLXRva2Vu'
) )
// Verify includeIf entries were added to local config
const includeIfKeys = await git.tryGetConfigKeys('^includeIf\\.gitdir:')
expect(includeIfKeys.length).toBeGreaterThan(0)
// Count credential includes pointing to this action's credentials file
let credentialIncludesForThisAction = 0
for (const key of includeIfKeys) {
const values = await git.tryGetConfigValues(key)
for (const value of values) {
if (value === credentialsPath) {
credentialIncludesForThisAction++
}
}
}
expect(credentialIncludesForThisAction).toBeGreaterThan(0)
await gitConfigHelper.close() await gitConfigHelper.close()
expect(await git.configExists(extraheaderConfigKey)).toBeFalsy()
// Verify credentials file was removed
const filesAfter = await fs.promises.readdir(runnerTemp)
const credentialsFilesAfter = filesAfter.filter(
f => f.startsWith('git-credentials-') && f.endsWith('.config')
)
expect(credentialsFilesAfter.length).toBe(0)
// Verify includeIf entries pointing to our specific credentials file were removed
const includeIfKeysAfter = await git.tryGetConfigKeys(
'^includeIf\\.gitdir:'
)
let credentialIncludesForThisActionAfter = 0
for (const key of includeIfKeysAfter) {
const values = await git.tryGetConfigValues(key)
for (const value of values) {
if (value === credentialsPath) {
credentialIncludesForThisActionAfter++
}
}
}
expect(credentialIncludesForThisActionAfter).toBe(0)
}) })
it('tests save and restore of persisted auth (old-style)', async () => { it('tests save and restore of persisted auth', async () => {
const extraheaderConfigValue = 'AUTHORIZATION: basic ***persisted-auth***' const extraheaderConfigValue = 'AUTHORIZATION: basic ***persisted-auth***'
await git.config(extraheaderConfigKey, extraheaderConfigValue) await git.config(extraheaderConfigKey, extraheaderConfigValue)
+182
View File
@@ -0,0 +1,182 @@
import {GitHubHelper} from '../lib/github-helper'
import {Commit, GitCommandManager} from '../lib/git-command-manager'
const mockOctokit = {
rest: {
git: {
createBlob: jest.fn(),
createTree: jest.fn(),
createCommit: jest.fn(),
createRef: jest.fn(),
getRef: jest.fn(),
updateRef: jest.fn()
},
repos: {
getBranch: jest.fn()
}
}
}
jest.mock('../lib/octokit-client', () => ({
Octokit: jest.fn(() => mockOctokit),
throttleOptions: {},
retryOptions: {}
}))
jest.mock('@octokit/request-error', () => ({RequestError: class {}}))
jest.mock('p-limit', () => () => (fn: () => unknown) => fn())
const NULL_SHA = '0000000000000000000000000000000000000000'
function makeCommit(changes: Commit['changes']): Commit {
return {
sha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
tree: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
parents: ['cccccccccccccccccccccccccccccccccccccccc'],
signed: false,
subject: 'Test commit',
body: '',
changes,
unparsedChanges: []
}
}
describe('github-helper unit tests', () => {
beforeEach(() => {
jest.clearAllMocks()
})
test('pushSignedCommits deletes a removed submodule instead of pointing it at the null sha', async () => {
const {git: gitApi} = mockOctokit.rest
gitApi.createBlob.mockResolvedValue({
data: {sha: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'}
})
gitApi.createTree.mockResolvedValue({
data: {sha: 'dddddddddddddddddddddddddddddddddddddddd'}
})
gitApi.createCommit.mockResolvedValue({
data: {
sha: 'ffffffffffffffffffffffffffffffffffffffff',
tree: {sha: 'dddddddddddddddddddddddddddddddddddddddd'},
verification: {verified: true, reason: 'valid'}
}
})
gitApi.createRef.mockResolvedValue({})
gitApi.getRef.mockRejectedValue(new Error('Not Found'))
const git = {
showFileAtRefBase64: jest.fn().mockResolvedValue('Y29udGVudA==')
}
const helper = new GitHubHelper('github.com', 'token')
const baseCommit = makeCommit([])
const commit = makeCommit([
{
mode: '160000',
dstSha: NULL_SHA,
status: 'D',
path: 'submodules/removed'
},
{
mode: '160000',
dstSha: '1111111111111111111111111111111111111111',
status: 'M',
path: 'submodules/updated'
},
{
mode: '100644',
dstSha: '2222222222222222222222222222222222222222',
status: 'M',
path: '.gitmodules'
}
])
await helper.pushSignedCommits(
git as unknown as GitCommandManager,
[commit],
baseCommit,
'/repo',
'owner/repo',
'branch'
)
expect(gitApi.createTree).toHaveBeenCalledTimes(1)
const {tree} = gitApi.createTree.mock.calls[0][0]
expect(tree).toEqual([
{
path: 'submodules/removed',
mode: '160000',
sha: null,
type: 'commit'
},
{
path: 'submodules/updated',
mode: '160000',
sha: '1111111111111111111111111111111111111111',
type: 'commit'
},
{
path: '.gitmodules',
mode: '100644',
sha: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
type: 'blob'
}
])
})
test('pushSignedCommits creates the ref when the branch name only resolves via a branch rename redirect', async () => {
const {git: gitApi, repos: reposApi} = mockOctokit.rest
// The branches API follows rename redirects and returns the renamed branch
reposApi.getBranch.mockResolvedValue({data: {name: 'renamed-branch'}})
gitApi.getRef.mockRejectedValue(new Error('Not Found'))
gitApi.createRef.mockResolvedValue({})
const helper = new GitHubHelper('github.com', 'token')
const baseCommit = makeCommit([])
await helper.pushSignedCommits(
{} as GitCommandManager,
[],
baseCommit,
'/repo',
'owner/repo',
'branch'
)
expect(gitApi.getRef).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo',
ref: 'heads/branch'
})
expect(gitApi.createRef).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo',
sha: baseCommit.sha,
ref: 'refs/heads/branch'
})
expect(gitApi.updateRef).not.toHaveBeenCalled()
})
test('pushSignedCommits updates the ref when the branch exists', async () => {
const {git: gitApi} = mockOctokit.rest
gitApi.getRef.mockResolvedValue({data: {ref: 'refs/heads/branch'}})
gitApi.updateRef.mockResolvedValue({})
const helper = new GitHubHelper('github.com', 'token')
const baseCommit = makeCommit([])
await helper.pushSignedCommits(
{} as GitCommandManager,
[],
baseCommit,
'/repo',
'owner/repo',
'branch'
)
expect(gitApi.updateRef).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo',
sha: baseCommit.sha,
ref: 'heads/branch',
force: true
})
expect(gitApi.createRef).not.toHaveBeenCalled()
})
})
+1 -1
View File
@@ -10,7 +10,7 @@ if [[ "$(docker images -q $IMAGE 2> /dev/null)" == "" || $ARG1 == "build" ]]; th
cat > Dockerfile << EOF cat > Dockerfile << EOF
FROM node:20-alpine FROM node:20-alpine
RUN apk --no-cache add git git-daemon RUN apk --no-cache add git git-daemon
RUN npm install jest jest-environment-jsdom --global RUN npm install jest@30 jest-environment-jsdom@30 --global
WORKDIR /cpr WORKDIR /cpr
COPY __test__/entrypoint.sh /entrypoint.sh COPY __test__/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
+68
View File
@@ -118,3 +118,71 @@ describe('utils tests', () => {
} }
}) })
}) })
describe('retryWithBackoff', () => {
const makeConsistencyError = () => {
const error = new Error(
'Validation Failed: "Could not resolve to a node with the global id of \'PR_abc123\'."'
)
;(error as any).status = 422
return error
}
const shouldRetry = (e: unknown): boolean =>
e instanceof Error &&
(e as any).status === 422 &&
e.message.includes('Could not resolve to a node')
test('succeeds on first attempt without retrying', async () => {
const fn = jest.fn().mockResolvedValue('success')
const result = await utils.retryWithBackoff(fn, shouldRetry, 2, 1)
expect(result).toBe('success')
expect(fn).toHaveBeenCalledTimes(1)
})
test('retries on eventual consistency 422 and succeeds', async () => {
const fn = jest
.fn()
.mockRejectedValueOnce(makeConsistencyError())
.mockResolvedValue('success')
const result = await utils.retryWithBackoff(fn, shouldRetry, 2, 1)
expect(result).toBe('success')
expect(fn).toHaveBeenCalledTimes(2)
})
test('exhausts retries on persistent 422 and throws', async () => {
const fn = jest.fn().mockRejectedValue(makeConsistencyError())
await expect(utils.retryWithBackoff(fn, shouldRetry, 2, 1)).rejects.toThrow(
'Could not resolve to a node'
)
expect(fn).toHaveBeenCalledTimes(3) // 1 initial + 2 retries
})
test('does not retry on non-422 errors', async () => {
const error = new Error('Forbidden')
;(error as any).status = 403
const fn = jest.fn().mockRejectedValue(error)
await expect(utils.retryWithBackoff(fn, shouldRetry, 2, 1)).rejects.toThrow(
'Forbidden'
)
expect(fn).toHaveBeenCalledTimes(1)
})
test('does not retry on 422 without the consistency error message', async () => {
const error = new Error('Validation Failed: invalid label')
;(error as any).status = 422
const fn = jest.fn().mockRejectedValue(error)
await expect(utils.retryWithBackoff(fn, shouldRetry, 2, 1)).rejects.toThrow(
'Validation Failed: invalid label'
)
expect(fn).toHaveBeenCalledTimes(1)
})
test('does not retry on plain Error objects', async () => {
const fn = jest.fn().mockRejectedValue(new Error('Something broke'))
await expect(utils.retryWithBackoff(fn, shouldRetry, 2, 1)).rejects.toThrow(
'Something broke'
)
expect(fn).toHaveBeenCalledTimes(1)
})
})
+134 -907
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -3,7 +3,7 @@ module.exports = {
moduleFileExtensions: ['js', 'ts'], moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node', testEnvironment: 'node',
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: { transform: {
'^.+\\.ts$': 'ts-jest' '^.+\\.ts$': 'ts-jest'
}, },
+2851 -1643
View File
File diff suppressed because it is too large. Load diff
+11 -12
View File
@@ -39,29 +39,28 @@
"@octokit/plugin-rest-endpoint-methods": "^13.5.0", "@octokit/plugin-rest-endpoint-methods": "^13.5.0",
"@octokit/plugin-retry": "^7.2.1", "@octokit/plugin-retry": "^7.2.1",
"@octokit/plugin-throttling": "^9.6.1", "@octokit/plugin-throttling": "^9.6.1",
"@octokit/request-error": "^6.1.8",
"node-fetch-native": "^1.6.7", "node-fetch-native": "^1.6.7",
"p-limit": "^6.2.0", "p-limit": "^6.2.0"
"uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^30.0.0",
"@types/node": "^18.19.130", "@types/node": "^18.19.130",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.4", "@vercel/ncc": "^0.45.0",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.10.1", "eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-github": "^4.10.2", "eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^27.9.0", "eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.5.4", "eslint-plugin-prettier": "^5.5.7",
"jest": "^29.7.0", "jest": "^30.5.2",
"jest-circus": "^29.7.0", "jest-environment-jsdom": "^30.5.2",
"jest-environment-jsdom": "^29.7.0", "js-yaml": "^5.5.0",
"js-yaml": "^4.1.1", "prettier": "^3.10.1",
"prettier": "^3.7.4", "ts-jest": "^29.4.15",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"undici": "^6.23.0" "undici": "^6.29.1"
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {randomUUID} from 'crypto'
import {GitCommandManager, Commit} from './git-command-manager' import {GitCommandManager, Commit} from './git-command-manager'
import {v4 as uuidv4} from 'uuid'
import * as utils from './utils' import * as utils from './utils'
const CHERRYPICK_EMPTY = const CHERRYPICK_EMPTY =
@@ -189,7 +189,7 @@ export async function createOrUpdateBranch(
const baseRemote = 'origin' const baseRemote = 'origin'
// Save the working base changes to a temporary branch // Save the working base changes to a temporary branch
const tempBranch = uuidv4() const tempBranch = randomUUID()
await git.checkout(tempBranch, 'HEAD') await git.checkout(tempBranch, 'HEAD')
// Commit any uncommitted changes // Commit any uncommitted changes
if (await git.isDirty(true, addPaths)) { if (await git.isDirty(true, addPaths)) {
+2 -69
View File
@@ -96,15 +96,9 @@ export class GitCommandManager {
configKey: string, configKey: string,
configValue: string, configValue: string,
globalConfig?: boolean, globalConfig?: boolean,
add?: boolean, add?: boolean
configFile?: string
): Promise<void> { ): Promise<void> {
const args: string[] = ['config'] const args: string[] = ['config', globalConfig ? '--global' : '--local']
if (configFile) {
args.push('--file', configFile)
} else {
args.push(globalConfig ? '--global' : '--local')
}
if (add) { if (add) {
args.push('--add') args.push('--add')
} }
@@ -356,67 +350,6 @@ export class GitCommandManager {
return output.exitCode === 0 return output.exitCode === 0
} }
async tryConfigUnsetValue(
configKey: string,
configValue: string,
globalConfig?: boolean,
configFile?: string
): Promise<boolean> {
const args = ['config']
if (configFile) {
args.push('--file', configFile)
} else {
args.push(globalConfig ? '--global' : '--local')
}
args.push('--fixed-value', '--unset', configKey, configValue)
const output = await this.exec(args, {allowAllExitCodes: true})
return output.exitCode === 0
}
async tryGetConfigValues(
configKey: string,
globalConfig?: boolean,
configFile?: string
): Promise<string[]> {
const args = ['config']
if (configFile) {
args.push('--file', configFile)
} else {
args.push(globalConfig ? '--global' : '--local')
}
args.push('--get-all', configKey)
const output = await this.exec(args, {allowAllExitCodes: true})
if (output.exitCode !== 0) {
return []
}
return output.stdout
.trim()
.split('\n')
.filter(value => value.trim())
}
async tryGetConfigKeys(
pattern: string,
globalConfig?: boolean,
configFile?: string
): Promise<string[]> {
const args = ['config']
if (configFile) {
args.push('--file', configFile)
} else {
args.push(globalConfig ? '--global' : '--local')
}
args.push('--name-only', '--get-regexp', pattern)
const output = await this.exec(args, {allowAllExitCodes: true})
if (output.exitCode !== 0) {
return []
}
return output.stdout
.trim()
.split('\n')
.filter(key => key.trim())
}
async tryGetRemoteUrl(): Promise<string> { async tryGetRemoteUrl(): Promise<string> {
const output = await this.exec( const output = await this.exec(
['config', '--local', '--get', 'remote.origin.url'], ['config', '--local', '--get', 'remote.origin.url'],
+74 -194
View File
@@ -4,7 +4,6 @@ import {GitCommandManager} from './git-command-manager'
import * as path from 'path' import * as path from 'path'
import {URL} from 'url' import {URL} from 'url'
import * as utils from './utils' import * as utils from './utils'
import {v4 as uuid} from 'uuid'
interface GitRemote { interface GitRemote {
hostname: string hostname: string
@@ -14,6 +13,7 @@ interface GitRemote {
export class GitConfigHelper { export class GitConfigHelper {
private git: GitCommandManager private git: GitCommandManager
private gitConfigPath = ''
private workingDirectory: string private workingDirectory: string
private safeDirectoryConfigKey = 'safe.directory' private safeDirectoryConfigKey = 'safe.directory'
private safeDirectoryAdded = false private safeDirectoryAdded = false
@@ -22,8 +22,7 @@ export class GitConfigHelper {
private extraheaderConfigPlaceholderValue = 'AUTHORIZATION: basic ***' private extraheaderConfigPlaceholderValue = 'AUTHORIZATION: basic ***'
private extraheaderConfigValueRegex = '^AUTHORIZATION:' private extraheaderConfigValueRegex = '^AUTHORIZATION:'
private persistedExtraheaderConfigValue = '' private persistedExtraheaderConfigValue = ''
// Path to the credentials config file in RUNNER_TEMP (new v6-style auth) private backedUpCredentialFiles: string[] = []
private credentialsConfigPath = ''
private constructor(git: GitCommandManager) { private constructor(git: GitCommandManager) {
this.git = git this.git = git
@@ -123,14 +122,15 @@ export class GitConfigHelper {
async savePersistedAuth(): Promise<void> { async savePersistedAuth(): Promise<void> {
const serverUrl = new URL(`https://${this.getGitRemote().hostname}`) const serverUrl = new URL(`https://${this.getGitRemote().hostname}`)
this.extraheaderConfigKey = `http.${serverUrl.origin}/.extraheader` this.extraheaderConfigKey = `http.${serverUrl.origin}/.extraheader`
// Save and unset persisted extraheader credential in git config if it exists (old-style auth) // Backup checkout@v6 credential files if they exist
// Note: checkout@v6 uses credentials files with includeIf, so we don't need to await this.hideCredentialFiles()
// manipulate those - they work independently via git's include mechanism // Save and unset persisted extraheader credential in git config if it exists
this.persistedExtraheaderConfigValue = await this.getAndUnset() this.persistedExtraheaderConfigValue = await this.getAndUnset()
} }
async restorePersistedAuth(): Promise<void> { async restorePersistedAuth(): Promise<void> {
// Restore old-style extraheader config if it was persisted // Restore checkout@v6 credential files if they were backed up
await this.unhideCredentialFiles()
if (this.persistedExtraheaderConfigValue) { if (this.persistedExtraheaderConfigValue) {
try { try {
await this.setExtraheaderConfig(this.persistedExtraheaderConfigValue) await this.setExtraheaderConfig(this.persistedExtraheaderConfigValue)
@@ -142,218 +142,81 @@ export class GitConfigHelper {
} }
async configureToken(token: string): Promise<void> { async configureToken(token: string): Promise<void> {
// Encode the basic credential for HTTPS access // Encode and configure the basic credential for HTTPS access
const basicCredential = Buffer.from( const basicCredential = Buffer.from(
`x-access-token:${token}`, `x-access-token:${token}`,
'utf8' 'utf8'
).toString('base64') ).toString('base64')
core.setSecret(basicCredential) core.setSecret(basicCredential)
const extraheaderConfigValue = `AUTHORIZATION: basic ${basicCredential}` const extraheaderConfigValue = `AUTHORIZATION: basic ${basicCredential}`
await this.setExtraheaderConfig(extraheaderConfigValue)
// Get or create the credentials config file path
const credentialsConfigPath = this.getCredentialsConfigPath()
// Write placeholder to the separate credentials config file using git config.
// This approach avoids the credential being captured by process creation audit events,
// which are commonly logged. For more information, refer to
// https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
await this.git.config(
this.extraheaderConfigKey,
this.extraheaderConfigPlaceholderValue,
false, // globalConfig
false, // add
credentialsConfigPath
)
// Replace the placeholder in the credentials config file
let content = (await fs.promises.readFile(credentialsConfigPath)).toString()
const placeholderIndex = content.indexOf(
this.extraheaderConfigPlaceholderValue
)
if (
placeholderIndex < 0 ||
placeholderIndex !=
content.lastIndexOf(this.extraheaderConfigPlaceholderValue)
) {
throw new Error(
`Unable to replace auth placeholder in ${credentialsConfigPath}`
)
}
content = content.replace(
this.extraheaderConfigPlaceholderValue,
extraheaderConfigValue
)
await fs.promises.writeFile(credentialsConfigPath, content)
// Configure includeIf entries to reference the credentials config file
await this.configureIncludeIf(credentialsConfigPath)
} }
async removeAuth(): Promise<void> { async removeAuth(): Promise<void> {
// Remove old-style extraheader config if it exists
await this.getAndUnset() await this.getAndUnset()
// Remove includeIf entries that point to git-credentials-*.config files
// and clean up the credentials config files
await this.removeIncludeIfCredentials()
} }
/**
* Gets or creates the path to the credentials config file in RUNNER_TEMP.
* @returns The absolute path to the credentials config file
*/
private getCredentialsConfigPath(): string {
if (this.credentialsConfigPath) {
return this.credentialsConfigPath
}
const runnerTemp = process.env['RUNNER_TEMP'] || ''
if (!runnerTemp) {
throw new Error('RUNNER_TEMP is not defined')
}
// Create a unique filename for this action instance
const configFileName = `git-credentials-${uuid()}.config`
this.credentialsConfigPath = path.join(runnerTemp, configFileName)
core.debug(`Credentials config path: ${this.credentialsConfigPath}`)
return this.credentialsConfigPath
}
/**
* Configures includeIf entries in the local git config to reference the credentials file.
* Sets up entries for both host and container paths to support Docker container actions.
*/
private async configureIncludeIf(
credentialsConfigPath: string
): Promise<void> {
// Host git directory
const gitDir = await this.git.getGitDirectory()
let hostGitDir = path.join(this.workingDirectory, gitDir)
hostGitDir = hostGitDir.replace(/\\/g, '/') // Use forward slashes, even on Windows
// Configure host includeIf
const hostIncludeKey = `includeIf.gitdir:${hostGitDir}.path`
await this.git.config(hostIncludeKey, credentialsConfigPath)
// Configure host includeIf for worktrees
const hostWorktreeIncludeKey = `includeIf.gitdir:${hostGitDir}/worktrees/*.path`
await this.git.config(hostWorktreeIncludeKey, credentialsConfigPath)
// Container paths for Docker container actions
const githubWorkspace = process.env['GITHUB_WORKSPACE']
if (githubWorkspace) {
let relativePath = path.relative(githubWorkspace, this.workingDirectory)
relativePath = relativePath.replace(/\\/g, '/') // Use forward slashes, even on Windows
const containerGitDir = path.posix.join(
'/github/workspace',
relativePath,
'.git'
)
// Container credentials config path
const containerCredentialsPath = path.posix.join(
'/github/runner_temp',
path.basename(credentialsConfigPath)
)
// Configure container includeIf
const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`
await this.git.config(containerIncludeKey, containerCredentialsPath)
// Configure container includeIf for worktrees
const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path`
await this.git.config(
containerWorktreeIncludeKey,
containerCredentialsPath
)
}
}
/**
* Removes the includeIf entry and credentials config file created by this action instance.
* Only cleans up the specific credentials file tracked in this.credentialsConfigPath,
* leaving credentials created by other actions (e.g., actions/checkout) intact.
*/
private async removeIncludeIfCredentials(): Promise<void> {
// Only clean up if this action instance created a credentials config file
if (!this.credentialsConfigPath) {
return
}
try {
// Get all includeIf.gitdir keys from local config
const keys = await this.git.tryGetConfigKeys('^includeIf\\.gitdir:')
for (const key of keys) {
// Get all values for this key
const values = await this.git.tryGetConfigValues(key)
for (const value of values) {
// Only remove entries pointing to our specific credentials file
if (value === this.credentialsConfigPath) {
await this.git.tryConfigUnsetValue(key, value)
core.debug(`Removed includeIf entry: ${key} = ${value}`)
}
}
}
} catch (e) {
// Ignore errors during cleanup
core.debug(`Error during includeIf cleanup: ${utils.getErrorMessage(e)}`)
}
// Delete only our credentials config file
const runnerTemp = process.env['RUNNER_TEMP']
const resolvedCredentialsPath = path.resolve(this.credentialsConfigPath)
const resolvedRunnerTemp = runnerTemp ? path.resolve(runnerTemp) : ''
if (
resolvedRunnerTemp &&
resolvedCredentialsPath.startsWith(resolvedRunnerTemp + path.sep)
) {
try {
await fs.promises.unlink(this.credentialsConfigPath)
core.info(
`Removed credentials config file: ${this.credentialsConfigPath}`
)
} catch (e) {
core.debug(
`Could not remove credentials file ${this.credentialsConfigPath}: ${utils.getErrorMessage(e)}`
)
}
}
}
/**
* Sets extraheader config directly in .git/config (old-style auth).
* Used only for restoring persisted credentials from checkout@v4/v5.
*/
private async setExtraheaderConfig( private async setExtraheaderConfig(
extraheaderConfigValue: string extraheaderConfigValue: string
): Promise<void> { ): Promise<void> {
// Configure a placeholder value. This approach avoids the credential being captured // Configure a placeholder value. This approach avoids the credential being captured
// by process creation audit events, which are commonly logged. For more information, // by process creation audit events, which are commonly logged. For more information,
// refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
// See https://github.com/actions/checkout/blob/main/src/git-auth-helper.ts#L267-L274
await this.git.config( await this.git.config(
this.extraheaderConfigKey, this.extraheaderConfigKey,
this.extraheaderConfigPlaceholderValue this.extraheaderConfigPlaceholderValue
) )
// Replace the placeholder in the local git config // Replace the placeholder
const gitDir = await this.git.getGitDirectory() await this.gitConfigStringReplace(
const gitConfigPath = path.join(this.workingDirectory, gitDir, 'config')
let content = (await fs.promises.readFile(gitConfigPath)).toString()
const index = content.indexOf(this.extraheaderConfigPlaceholderValue)
if (
index < 0 ||
index != content.lastIndexOf(this.extraheaderConfigPlaceholderValue)
) {
throw new Error(
`Unable to replace '${this.extraheaderConfigPlaceholderValue}' in ${gitConfigPath}`
)
}
content = content.replace(
this.extraheaderConfigPlaceholderValue, this.extraheaderConfigPlaceholderValue,
extraheaderConfigValue extraheaderConfigValue
) )
await fs.promises.writeFile(gitConfigPath, content) }
private async hideCredentialFiles(): Promise<void> {
// Temporarily hide checkout@v6 credential files to avoid duplicate auth headers
const runnerTemp = process.env['RUNNER_TEMP']
if (!runnerTemp) {
return
}
try {
const files = await fs.promises.readdir(runnerTemp)
for (const file of files) {
if (file.startsWith('git-credentials-') && file.endsWith('.config')) {
const sourcePath = path.join(runnerTemp, file)
const backupPath = `${sourcePath}.bak`
await fs.promises.rename(sourcePath, backupPath)
this.backedUpCredentialFiles.push(backupPath)
core.info(
`Temporarily hiding checkout credential file: ${file} (will be restored after)`
)
}
}
} catch (e) {
// If directory doesn't exist or we can't read it, just continue
core.debug(
`Could not backup credential files: ${utils.getErrorMessage(e)}`
)
}
}
private async unhideCredentialFiles(): Promise<void> {
// Restore checkout@v6 credential files that were backed up
for (const backupPath of this.backedUpCredentialFiles) {
try {
const originalPath = backupPath.replace(/\.bak$/, '')
await fs.promises.rename(backupPath, originalPath)
const fileName = path.basename(originalPath)
core.info(`Restored checkout credential file: ${fileName}`)
} catch (e) {
core.warning(
`Failed to restore credential file ${backupPath}: ${utils.getErrorMessage(e)}`
)
}
}
this.backedUpCredentialFiles = []
} }
private async getAndUnset(): Promise<string> { private async getAndUnset(): Promise<string> {
@@ -384,4 +247,21 @@ export class GitConfigHelper {
} }
return configValue return configValue
} }
private async gitConfigStringReplace(
find: string,
replace: string
): Promise<void> {
if (this.gitConfigPath.length === 0) {
const gitDir = await this.git.getGitDirectory()
this.gitConfigPath = path.join(this.workingDirectory, gitDir, 'config')
}
let content = (await fs.promises.readFile(this.gitConfigPath)).toString()
const index = content.indexOf(find)
if (index < 0 || index != content.lastIndexOf(find)) {
throw new Error(`Unable to replace '${find}' in ${this.gitConfigPath}`)
}
content = content.replace(find, replace)
await fs.promises.writeFile(this.gitConfigPath, content)
}
} }
+52 -25
View File
@@ -1,4 +1,5 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {RequestError} from '@octokit/request-error'
import {Inputs} from './create-pull-request' import {Inputs} from './create-pull-request'
import {Commit, GitCommandManager} from './git-command-manager' import {Commit, GitCommandManager} from './git-command-manager'
import { import {
@@ -209,32 +210,51 @@ export class GitHubHelper {
headRepository headRepository
) )
// After creating a new PR, follow-up API calls can fail with a 422
// "Could not resolve to a node" error due to GitHub API eventual
// consistency. Wrap post-creation calls with targeted retry logic.
// See: https://github.com/peter-evans/create-pull-request/issues/4321
const isEventualConsistencyError = (e: unknown): boolean =>
e instanceof RequestError &&
e.status === 422 &&
e.message.includes('Could not resolve to a node')
const withRetryForNewPr = <T>(fn: () => Promise<T>): Promise<T> =>
pull.created
? utils.retryWithBackoff(fn, isEventualConsistencyError)
: fn()
// Apply milestone // Apply milestone
if (inputs.milestone) { if (inputs.milestone) {
core.info(`Applying milestone '${inputs.milestone}'`) core.info(`Applying milestone '${inputs.milestone}'`)
await this.octokit.rest.issues.update({ await withRetryForNewPr(() =>
...this.parseRepository(baseRepository), this.octokit.rest.issues.update({
issue_number: pull.number, ...this.parseRepository(baseRepository),
milestone: inputs.milestone issue_number: pull.number,
}) milestone: inputs.milestone
})
)
} }
// Apply labels // Apply labels
if (inputs.labels.length > 0) { if (inputs.labels.length > 0) {
core.info(`Applying labels '${inputs.labels}'`) core.info(`Applying labels '${inputs.labels}'`)
await this.octokit.rest.issues.addLabels({ await withRetryForNewPr(() =>
...this.parseRepository(baseRepository), this.octokit.rest.issues.addLabels({
issue_number: pull.number, ...this.parseRepository(baseRepository),
labels: inputs.labels issue_number: pull.number,
}) labels: inputs.labels
})
)
} }
// Apply assignees // Apply assignees
if (inputs.assignees.length > 0) { if (inputs.assignees.length > 0) {
core.info(`Applying assignees '${inputs.assignees}'`) core.info(`Applying assignees '${inputs.assignees}'`)
await this.octokit.rest.issues.addAssignees({ await withRetryForNewPr(() =>
...this.parseRepository(baseRepository), this.octokit.rest.issues.addAssignees({
issue_number: pull.number, ...this.parseRepository(baseRepository),
assignees: inputs.assignees issue_number: pull.number,
}) assignees: inputs.assignees
})
)
} }
// Request reviewers and team reviewers // Request reviewers and team reviewers
@@ -250,11 +270,13 @@ export class GitHubHelper {
} }
if (Object.keys(requestReviewersParams).length > 0) { if (Object.keys(requestReviewersParams).length > 0) {
try { try {
await this.octokit.rest.pulls.requestReviewers({ await withRetryForNewPr(() =>
...this.parseRepository(baseRepository), this.octokit.rest.pulls.requestReviewers({
pull_number: pull.number, ...this.parseRepository(baseRepository),
...requestReviewersParams pull_number: pull.number,
}) ...requestReviewersParams
})
)
} catch (e) { } catch (e) {
if (utils.getErrorMessage(e).includes(ERROR_PR_REVIEW_TOKEN_SCOPE)) { if (utils.getErrorMessage(e).includes(ERROR_PR_REVIEW_TOKEN_SCOPE)) {
core.error( core.error(
@@ -310,11 +332,14 @@ export class GitHubHelper {
commit.changes.map(async ({path, mode, status, dstSha}) => { commit.changes.map(async ({path, mode, status, dstSha}) => {
if (mode === '160000') { if (mode === '160000') {
// submodule // submodule
core.info(`Creating tree object for submodule commit at '${path}'`) core.info(
`Creating tree object for submodule commit at '${path}' with status '${status}'`
)
return <TreeObject>{ return <TreeObject>{
path, path,
mode, mode,
sha: dstSha, // A deleted submodule has a null dstSha; a null sha deletes the entry
sha: status === 'D' ? null : dstSha,
type: 'commit' type: 'commit'
} }
} else { } else {
@@ -413,10 +438,12 @@ export class GitHubHelper {
newHead: string newHead: string
) { ) {
const repository = this.parseRepository(branchRepository) const repository = this.parseRepository(branchRepository)
const branchExists = await this.octokit.rest.repos // Check the git ref directly rather than using the branches API, which
.getBranch({ // follows branch rename redirects and can return a different branch.
const branchExists = await this.octokit.rest.git
.getRef({
...repository, ...repository,
branch: branch ref: `heads/${branch}`
}) })
.then( .then(
() => true, () => true,
+24
View File
@@ -140,3 +140,27 @@ export const isSelfHosted = (): boolean =>
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' && process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
(process.env['AGENT_ISSELFHOSTED'] === '1' || (process.env['AGENT_ISSELFHOSTED'] === '1' ||
process.env['AGENT_ISSELFHOSTED'] === undefined) process.env['AGENT_ISSELFHOSTED'] === undefined)
export async function retryWithBackoff<T>(
fn: () => Promise<T>,
shouldRetry: (error: unknown) => boolean,
maxRetries = 2,
delayMs = 1000
): Promise<T> {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
try {
return await fn()
} catch (e) {
if (attempt < maxRetries && shouldRetry(e)) {
const delay = delayMs * Math.pow(2, attempt)
core.info(
`Request failed (attempt ${attempt + 1}/${maxRetries + 1}), retrying in ${delay}ms...`
)
await new Promise(resolve => setTimeout(resolve, delay))
} else {
throw e
}
}
}
throw new Error('Unexpected: retry loop exited without return or throw')
}