Compare commits

..
Author SHA1 Message Date
copilot-swe-agent[bot]andCopilot c9d6e44db2 fix: check git ref directly when pushing signed commits
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 <223556219+Copilot@users.noreply.github.com>
2026-11-10 11:40:59 +00:00
5 changed files with 12 additions and 16 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@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
commit-message: 'build: update distribution'
+1 -3
View File
@@ -27,9 +27,7 @@ jobs:
git config user.name actions-bot
git config user.email actions-bot@users.noreply.github.com
- name: Tag new target
run: |
sha=$(git rev-parse --verify --end-of-options "${INPUT_TARGET}^{commit}")
git tag -f "${INPUT_MAIN_VERSION}" "${sha}"
run: git tag -f "${INPUT_MAIN_VERSION}" "${INPUT_TARGET}"
env:
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
INPUT_TARGET: ${{ github.event.inputs.target }}
+2 -4
View File
@@ -1644,10 +1644,8 @@ class GitHubHelper {
createOrUpdateRef(branchRepository, branch, newHead) {
return __awaiter(this, void 0, void 0, function* () {
const repository = this.parseRepository(branchRepository);
// 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}` }))
const branchExists = yield this.octokit.rest.repos
.getBranch(Object.assign(Object.assign({}, repository), { branch: 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.10.1",
"prettier": "^3.9.10",
"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.1.2",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -8333,9 +8333,9 @@
}
},
"node_modules/prettier": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
"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.10.1",
"prettier": "^3.9.10",
"ts-jest": "^29.4.15",
"typescript": "^5.9.3",
"undici": "^6.29.1"