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
7 changed files with 88 additions and 18 deletions

No files matched your search

+1 -1
View File
@@ -124,7 +124,7 @@ jobs:
name: dist
path: dist
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
commit-message: 'build: update distribution'
+3 -1
View File
@@ -27,7 +27,9 @@ jobs:
git config user.name actions-bot
git config user.email actions-bot@users.noreply.github.com
- name: Tag new target
run: git tag -f "${INPUT_MAIN_VERSION}" "${INPUT_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 }}
+67 -3
View File
@@ -7,7 +7,9 @@ const mockOctokit = {
createBlob: jest.fn(),
createTree: jest.fn(),
createCommit: jest.fn(),
createRef: jest.fn()
createRef: jest.fn(),
getRef: jest.fn(),
updateRef: jest.fn()
},
repos: {
getBranch: jest.fn()
@@ -38,8 +40,12 @@ function makeCommit(changes: Commit['changes']): Commit {
}
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, repos: reposApi} = mockOctokit.rest
const {git: gitApi} = mockOctokit.rest
gitApi.createBlob.mockResolvedValue({
data: {sha: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'}
})
@@ -54,7 +60,7 @@ describe('github-helper unit tests', () => {
}
})
gitApi.createRef.mockResolvedValue({})
reposApi.getBranch.mockRejectedValue(new Error('Branch not found'))
gitApi.getRef.mockRejectedValue(new Error('Not Found'))
const git = {
showFileAtRefBase64: jest.fn().mockResolvedValue('Y29udGVudA==')
}
@@ -115,4 +121,62 @@ describe('github-helper unit tests', () => {
}
])
})
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()
})
})
+4 -2
View File
@@ -1644,8 +1644,10 @@ class GitHubHelper {
createOrUpdateRef(branchRepository, branch, newHead) {
return __awaiter(this, void 0, void 0, function* () {
const repository = this.parseRepository(branchRepository);
const branchExists = yield this.octokit.rest.repos
.getBranch(Object.assign(Object.assign({}, repository), { branch: branch }))
// Check the git ref directly rather than using the branches API, which
// follows branch rename redirects and can return a different branch.
const branchExists = yield this.octokit.rest.git
.getRef(Object.assign(Object.assign({}, repository), { ref: `heads/${branch}` }))
.then(() => true, () => false);
if (branchExists) {
core.info(`Branch ${branch} exists; Updating ref`);
+7 -7
View File
@@ -35,7 +35,7 @@
"jest": "^30.5.2",
"jest-environment-jsdom": "^30.5.2",
"js-yaml": "^5.5.0",
"prettier": "^3.9.10",
"prettier": "^3.10.1",
"ts-jest": "^29.4.15",
"typescript": "^5.9.3",
"undici": "^6.29.1"
@@ -4065,9 +4065,9 @@
"dev": true
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -8333,9 +8333,9 @@
}
},
"node_modules/prettier": {
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
"dev": true,
"license": "MIT",
"bin": {
+1 -1
View File
@@ -58,7 +58,7 @@
"jest": "^30.5.2",
"jest-environment-jsdom": "^30.5.2",
"js-yaml": "^5.5.0",
"prettier": "^3.9.10",
"prettier": "^3.10.1",
"ts-jest": "^29.4.15",
"typescript": "^5.9.3",
"undici": "^6.29.1"
+5 -3
View File
@@ -438,10 +438,12 @@ export class GitHubHelper {
newHead: string
) {
const repository = this.parseRepository(branchRepository)
const branchExists = await this.octokit.rest.repos
.getBranch({
// Check the git ref directly rather than using the branches API, which
// follows branch rename redirects and can return a different branch.
const branchExists = await this.octokit.rest.git
.getRef({
...repository,
branch: branch
ref: `heads/${branch}`
})
.then(
() => true,