Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
258b03e458 | ||
|
|
e29927bef7 | ||
|
|
06508be0e0 | ||
|
|
8f4eb24e77 |
No files matched your search
@@ -49,6 +49,21 @@ jobs:
|
||||
echo "created label: ${name}"
|
||||
done
|
||||
|
||||
# The label fix above is not retroactive. PR #22 was merged with
|
||||
# `autorelease: pending` but its head branch had already been deleted,
|
||||
# so the action reports `Bad branch name: refs/pull/22/head`, creates no
|
||||
# tag and leaves the label behind. Every later run then aborts with
|
||||
# "There are untagged, merged release PRs outstanding" and never opens a
|
||||
# new release PR - green, no tags. This step reconciles that state before
|
||||
# the action runs: mark a pending PR tagged when its tag already exists,
|
||||
# or recreate the tag when the head branch is gone and release-please
|
||||
# therefore cannot. See scripts/reconcile-release-please.mjs and
|
||||
# OKF_Nuxt/decisions/release-engineering.md.
|
||||
- name: Reconcile stale release-please state
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.PR_GITEA_TOKEN }}
|
||||
run: node scripts/reconcile-release-please.mjs
|
||||
|
||||
- uses: joaquinjsb/gitea-release-please-action@v4
|
||||
with:
|
||||
# One well-scoped token for all workflow API work (see
|
||||
|
||||
@@ -16,6 +16,9 @@ sources:
|
||||
- id: workflow
|
||||
resource: .gitea/workflows/release-please.yml
|
||||
title: release-please workflow
|
||||
- id: reconcile
|
||||
resource: scripts/reconcile-release-please.mjs
|
||||
title: release-please state reconciliation
|
||||
---
|
||||
|
||||
# Decision
|
||||
@@ -97,6 +100,49 @@ confirmed by comparison, not inference: while `fix/release_please` still
|
||||
existed, PR #23 reported `head.ref = fix/release_please`; every PR whose
|
||||
branch was gone reported `refs/pull/<n>/head`.
|
||||
|
||||
# A pending label outlives the branch and blocks every later release (2026-10-31)
|
||||
|
||||
Flipping `default_delete_branch_after_merge` to `false` only protects
|
||||
branches deleted *after* the change. PR #22's branch was already gone, so
|
||||
its `head.ref` stayed `refs/pull/22/head` and its `autorelease: pending`
|
||||
label stayed attached. Run 143 (task 475, 2026-10-27, the run immediately
|
||||
after #22 merged) shows the full deadlock:
|
||||
|
||||
```
|
||||
❯ Found pull request #22: 'chore: release main'
|
||||
✖ Bad branch name: refs/pull/22/head
|
||||
...
|
||||
✔ Building candidate release pull request for path: .
|
||||
❯ Found pull request #22: 'chore: release main'
|
||||
⚠ There are untagged, merged release PRs outstanding - aborting
|
||||
::set-output:: prs_created=false
|
||||
::set-output:: releases_created=false
|
||||
```
|
||||
|
||||
The first block fails the tagging phase. The second finds the same
|
||||
still-pending PR and aborts the propose phase, so no new release PR is
|
||||
even opened. Every later run (145, 148, 151, 153, 162, 164, 167) has the
|
||||
same shape. The hand-created `v1.4.0` tag restores the baseline (`found:
|
||||
v1.4.0`) but does not clear the label, so it does not break the
|
||||
deadlock. This is the current reason the pipeline is still healthy-looking
|
||||
and tagless.
|
||||
|
||||
The workflow now reconciles that state before the action runs
|
||||
(`scripts/reconcile-release-please.mjs`):
|
||||
|
||||
* merged + `autorelease: pending` + a tag already at the merge commit ->
|
||||
replace the label with `autorelease: tagged`;
|
||||
* merged + `autorelease: pending` + head branch gone + no tag -> create
|
||||
the tag from the version recorded in the manifest at the merge commit
|
||||
(the exact tag release-please would have made), then swap the label;
|
||||
* merged + `autorelease: pending` + head branch still present -> leave
|
||||
it; release-please tags it in the same run.
|
||||
|
||||
The step is idempotent and runs on every push to `main` and every manual
|
||||
dispatch, so a deleted branch cannot silently poison the release pipeline
|
||||
again. #20 and #21 are not labelled pending, so they do not block; their
|
||||
tags remain the one-time manual recovery in the table below.
|
||||
|
||||
# Recovering the versions that never got a tag
|
||||
|
||||
The label alone cannot recover them — #20, #21 and #22 all lost their head
|
||||
@@ -123,6 +169,11 @@ whole history.
|
||||
|
||||
* That the release phase tags correctly once the head branch survives a
|
||||
merge. The next release cycle proves it.
|
||||
* That the reconcile step's tag-creation fallback works with a live
|
||||
token. Only the tag-already-exists path was exercised, in dry-run,
|
||||
against the live PR #22. The fallback is written from the same Gitea
|
||||
API shapes (`POST /tags`, `PUT /issues/{index}/labels`) the rest of the
|
||||
workflow uses.
|
||||
* That `RELEASE_PLEASE_TOKEN_CV_SITE_NUXT` carries the `write:issue`
|
||||
scope the same way `PR_GITEA_TOKEN` needed it; the previous failure
|
||||
was an immediate API rejection consistent with a scope problem.
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Update Log
|
||||
|
||||
## 2026-10-31 (release-please still never tagged: the stale pending label)
|
||||
|
||||
* **Fix**: [release-please.yml](../.gitea/workflows/release-please.yml) now runs [scripts/reconcile-release-please.mjs](../scripts/reconcile-release-please.mjs) before the action. The branch-deletion fix from 2026-10-27 only protects branches deleted after the setting changed; PR #22's branch was already gone, so its `autorelease: pending` label was never cleared. The action therefore finds #22 on every run, logs `Bad branch name: refs/pull/22/head`, creates no tag, and then aborts the propose phase with `There are untagged, merged release PRs outstanding` - `prs_created=false`, `releases_created=false`, exit code 0. Evidence: run 143 (task 475, immediately after #22 merged) and every run through 167 has that exact shape; the hand-created `v1.4.0` tag makes the baseline work (`found: v1.4.0`) but does not clear the label. The reconcile script marks a pending PR tagged when its tag already exists, and recreates the tag from the manifest at the merge commit when the head branch is gone and the tag is missing. A dry run against the live API correctly matches #22 to `v1.4.0` and proposes `autorelease: tagged`. See [Release engineering](decisions/release-engineering.md).
|
||||
|
||||
## 2026-10-30 (PR-Agent moved into the Gitea compose stack)
|
||||
|
||||
* **Refactor**: the `pr-agent` service now lives in `/home/noel/self-hosted/gitea/docker-compose.yml` with `/home/noel/self-hosted/gitea/pr-agent.env`. The separate `/home/noel/self-hosted/pr-agent` stack and the unused `/opt` operator-access scripts were removed; the service is managed with the Gitea stack.
|
||||
|
||||
Generated
+11
-13
@@ -14,13 +14,13 @@ importers:
|
||||
dependencies:
|
||||
'@iconify-json/material-symbols':
|
||||
specifier: ^1.2.95
|
||||
version: 1.2.95
|
||||
version: 1.2.97
|
||||
'@nuxt/icon':
|
||||
specifier: 2.6.2
|
||||
version: 2.6.2(@nuxt/schema@4.6.2)(confbox@0.3.1)(dotenv@17.4.2)(giget@3.3.1)(jiti@2.7.0)(magic-string@1.4.3)(oxc-parser@0.153.0)(rolldown@1.2.14)(unplugin@3.4.0(esbuild@0.28.2)(rolldown@1.2.14)(rollup@4.64.8)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1)))(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue@3.5.44(typescript@5.9.3))
|
||||
'@nuxtjs/i18n':
|
||||
specifier: 10.6.0
|
||||
version: 10.6.0(@nuxt/schema@4.6.2)(@vue/compiler-dom@3.5.44)(db0@0.3.4)(dotenv@17.4.2)(esbuild@0.28.2)(giget@3.3.1)(ioredis@5.11.1(supports-color@10.2.2))(jiti@2.7.0)(rolldown@1.2.14)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue@3.5.44(typescript@5.9.3))
|
||||
version: 10.6.0(@nuxt/schema@4.6.2)(db0@0.3.4)(dotenv@17.4.2)(esbuild@0.28.2)(giget@3.3.1)(ioredis@5.11.1(supports-color@10.2.2))(jiti@2.7.0)(rolldown@1.2.14)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue@3.5.44(typescript@5.9.3))
|
||||
'@nuxtjs/seo':
|
||||
specifier: 6.0.1
|
||||
version: 6.0.1(b12aa32157ad38cf444edd41e3e089a9)
|
||||
@@ -677,8 +677,8 @@ packages:
|
||||
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
|
||||
engines: {node: '>=18.18'}
|
||||
|
||||
'@iconify-json/material-symbols@1.2.95':
|
||||
resolution: {integrity: sha512-n34GNbwe8We3LPXK2N8JuQewEQkITJiRsmX/0UYJsOyKzviVl22mNfLUiGGtXLKDPqxZa17q1Hg57zdA3BYa0w==}
|
||||
'@iconify-json/material-symbols@1.2.97':
|
||||
resolution: {integrity: sha512-MbE4QHrH4Z4eoerBFrzFSPqHw2NwVGwwOwGZdJym5l5N5loqEUThimlQpK9VJA6mvgWvj5jl43b8bZnqzOxNRQ==}
|
||||
|
||||
'@iconify/collections@1.0.758':
|
||||
resolution: {integrity: sha512-i6z8ImaR9gH/Kj51H81JmGaX1K5OF+SuNZB4DxJwgdweZUBguMaL62EDFqIwF1V8xKfGrOJRB/tx4csYXaNl0w==}
|
||||
@@ -6103,7 +6103,7 @@ snapshots:
|
||||
|
||||
'@humanwhocodes/retry@0.4.3': {}
|
||||
|
||||
'@iconify-json/material-symbols@1.2.95':
|
||||
'@iconify-json/material-symbols@1.2.97':
|
||||
dependencies:
|
||||
'@iconify/types': 2.0.0
|
||||
|
||||
@@ -6164,11 +6164,11 @@ snapshots:
|
||||
|
||||
'@intlify/shared@11.4.16': {}
|
||||
|
||||
'@intlify/unplugin-vue-i18n@11.2.7(@vue/compiler-dom@3.5.44)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))':
|
||||
'@intlify/unplugin-vue-i18n@11.2.7(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))':
|
||||
dependencies:
|
||||
'@intlify/bundle-utils': 11.2.7(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))
|
||||
'@intlify/shared': 11.4.16
|
||||
'@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.4.16)(@vue/compiler-dom@3.5.44)(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))
|
||||
'@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.4.16)(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))
|
||||
'@rollup/pluginutils': 5.4.0(rollup@4.64.8)
|
||||
'@typescript-eslint/scope-manager': 8.71.2
|
||||
'@typescript-eslint/typescript-estree': 8.71.2(supports-color@10.2.2)(typescript@5.9.3)
|
||||
@@ -6182,7 +6182,6 @@ snapshots:
|
||||
vite: 8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1)
|
||||
vue-i18n: 11.4.16(vue@3.5.44(typescript@5.9.3))
|
||||
transitivePeerDependencies:
|
||||
- '@vue/compiler-dom'
|
||||
- rollup
|
||||
- supports-color
|
||||
- typescript
|
||||
@@ -6191,12 +6190,12 @@ snapshots:
|
||||
|
||||
'@intlify/utils@0.14.1': {}
|
||||
|
||||
'@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.4.16)(@vue/compiler-dom@3.5.44)(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))':
|
||||
'@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.4.16)(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))':
|
||||
dependencies:
|
||||
'@babel/parser': 7.29.9
|
||||
'@vue/compiler-dom': 3.5.44
|
||||
optionalDependencies:
|
||||
'@intlify/shared': 11.4.16
|
||||
'@vue/compiler-dom': 3.5.44
|
||||
vue: 3.5.44(typescript@5.9.3)
|
||||
vue-i18n: 11.4.16(vue@3.5.44(typescript@5.9.3))
|
||||
|
||||
@@ -6963,13 +6962,13 @@ snapshots:
|
||||
- rolldown
|
||||
- unplugin
|
||||
|
||||
'@nuxtjs/i18n@10.6.0(@nuxt/schema@4.6.2)(@vue/compiler-dom@3.5.44)(db0@0.3.4)(dotenv@17.4.2)(esbuild@0.28.2)(giget@3.3.1)(ioredis@5.11.1(supports-color@10.2.2))(jiti@2.7.0)(rolldown@1.2.14)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue@3.5.44(typescript@5.9.3))':
|
||||
'@nuxtjs/i18n@10.6.0(@nuxt/schema@4.6.2)(db0@0.3.4)(dotenv@17.4.2)(esbuild@0.28.2)(giget@3.3.1)(ioredis@5.11.1(supports-color@10.2.2))(jiti@2.7.0)(rolldown@1.2.14)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue@3.5.44(typescript@5.9.3))':
|
||||
dependencies:
|
||||
'@intlify/core': 11.4.16
|
||||
'@intlify/h3': 0.7.4
|
||||
'@intlify/message-compiler': 11.4.16
|
||||
'@intlify/shared': 11.4.16
|
||||
'@intlify/unplugin-vue-i18n': 11.2.7(@vue/compiler-dom@3.5.44)(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))
|
||||
'@intlify/unplugin-vue-i18n': 11.2.7(rollup@4.64.8)(supports-color@10.2.2)(typescript@5.9.3)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1))(vue-i18n@11.4.16(vue@3.5.44(typescript@5.9.3)))(vue@3.5.44(typescript@5.9.3))
|
||||
'@intlify/utils': 0.14.1
|
||||
'@miyaneee/rollup-plugin-json5': 1.2.0(rollup@4.64.8)
|
||||
'@nuxt/kit': 4.6.2(@nuxt/schema@4.6.2)(confbox@0.2.4)(dotenv@17.4.2)(giget@3.3.1)(jiti@2.7.0)(magic-string@0.30.21)(mlly@1.8.2)(oxc-parser@0.141.0)(rolldown@1.2.14)(unplugin@3.4.0(esbuild@0.28.2)(rolldown@1.2.14)(rollup@4.64.8)(vite@8.3.4(esbuild@0.28.2)(jiti@2.7.0)(terser@5.51.2)(yaml@2.9.1)))
|
||||
@@ -7014,7 +7013,6 @@ snapshots:
|
||||
- '@vercel/blob'
|
||||
- '@vercel/functions'
|
||||
- '@vercel/kv'
|
||||
- '@vue/compiler-dom'
|
||||
- aws4fetch
|
||||
- bun-types-no-globals
|
||||
- db0
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
// Repairs the release-please state that its Gitea fork cannot recover from.
|
||||
//
|
||||
// Why this exists (evidence in OKF_Nuxt/decisions/release-engineering.md):
|
||||
//
|
||||
// Gitea rewrites a merged PR's `head.ref` to `refs/pull/<n>/head` when the
|
||||
// head branch is deleted. The fork parses that field as the release branch,
|
||||
// logs `Bad branch name`, creates no tag - and still exits successfully.
|
||||
// The merged PR keeps `autorelease: pending`, so every later run aborts with
|
||||
// `There are untagged, merged release PRs outstanding` and opens no new
|
||||
// release PR. That is a permanent deadlock, not a transient failure.
|
||||
//
|
||||
// This script runs before the action and reconciles the state:
|
||||
//
|
||||
// * a merged pending PR whose merge commit already has a tag -> swap
|
||||
// `autorelease: pending` for `autorelease: tagged` (the release exists,
|
||||
// only the label is stale);
|
||||
// * a merged pending PR whose head branch is gone and has no tag -> create
|
||||
// the tag from the version recorded in the manifest at that merge commit.
|
||||
// This is exactly the tag release-please would have made if the branch had
|
||||
// survived; without it the PR blocks every future release;
|
||||
// * a merged pending PR whose head branch still exists -> leave it alone,
|
||||
// release-please tags it in the same run.
|
||||
//
|
||||
// Run locally against the public API with:
|
||||
// DRY_RUN=1 node scripts/reconcile-release-please.mjs
|
||||
// Reads work unauthenticated for a public repository; writes are skipped.
|
||||
|
||||
const API_URL = process.env.GITHUB_API_URL
|
||||
const REPOSITORY = process.env.GITHUB_REPOSITORY
|
||||
const TOKEN = process.env.GITEA_TOKEN
|
||||
const DRY_RUN = process.env.DRY_RUN === '1' || process.argv.includes('--dry-run')
|
||||
|
||||
const PENDING = 'autorelease: pending'
|
||||
const TAGGED = 'autorelease: tagged'
|
||||
|
||||
if (!API_URL || !REPOSITORY) {
|
||||
console.error('::error::GITHUB_API_URL and GITHUB_REPOSITORY must be set')
|
||||
process.exit(1)
|
||||
}
|
||||
if (!TOKEN && !DRY_RUN) {
|
||||
console.error('::error::GITEA_TOKEN is required (or set DRY_RUN=1)')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const repoUrl = `${API_URL}/repos/${REPOSITORY}`
|
||||
|
||||
const api = async (path, init = {}) => {
|
||||
const response = await fetch(`${repoUrl}${path}`, {
|
||||
...init,
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
...(TOKEN ? { Authorization: `token ${TOKEN}` } : {}),
|
||||
...(init.headers ?? {}),
|
||||
},
|
||||
})
|
||||
const body = await response.text()
|
||||
if (!response.ok) {
|
||||
throw new Error(`${init.method ?? 'GET'} ${path} -> HTTP ${response.status}: ${body.slice(0, 300)}`)
|
||||
}
|
||||
return body ? JSON.parse(body) : null
|
||||
}
|
||||
|
||||
// Gitea caps page size at 50. Follow pages until a short page ends the list.
|
||||
const listAll = async (path) => {
|
||||
const items = []
|
||||
for (let page = 1; ; page++) {
|
||||
const separator = path.includes('?') ? '&' : '?'
|
||||
const batch = await api(`${path}${separator}limit=50&page=${page}`)
|
||||
items.push(...batch)
|
||||
if (batch.length < 50) return items
|
||||
}
|
||||
}
|
||||
|
||||
const replaceLabels = async (number, labels) => {
|
||||
if (DRY_RUN) {
|
||||
console.log(`[dry-run] #${number}: labels -> ${labels.join(', ')}`)
|
||||
return
|
||||
}
|
||||
await api(`/issues/${number}/labels`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ labels }),
|
||||
})
|
||||
}
|
||||
|
||||
const createTag = async (name, sha) => {
|
||||
if (DRY_RUN) {
|
||||
console.log(`[dry-run] create tag ${name} at ${sha}`)
|
||||
return
|
||||
}
|
||||
await api('/tags', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ tag_name: name, target: sha, message: `Release ${name}` }),
|
||||
})
|
||||
}
|
||||
|
||||
const versionAt = async (sha) => {
|
||||
const file = await api(`/contents/.release-please-manifest.json?ref=${sha}`)
|
||||
if (!file?.content) throw new Error(`no manifest content at ${sha}`)
|
||||
const manifest = JSON.parse(Buffer.from(file.content, 'base64').toString('utf8'))
|
||||
// Single-package repository: the root path is ".". Keep a fallback so a
|
||||
// future second package cannot silently produce `vundefined`.
|
||||
return manifest['.'] ?? Object.values(manifest)[0]
|
||||
}
|
||||
|
||||
const run = async () => {
|
||||
const tags = await listAll('/tags')
|
||||
const tagSha = new Map(tags.map(tag => [tag.commit?.sha, tag.name]))
|
||||
const tagsByName = new Map(tags.map(tag => [tag.name, tag.commit?.sha]))
|
||||
|
||||
const pulls = await listAll('/pulls?state=closed')
|
||||
const pending = pulls
|
||||
.filter(pull => pull.merged_at)
|
||||
.filter(pull => (pull.labels ?? []).some(label => label.name === PENDING))
|
||||
.sort((a, b) => a.number - b.number)
|
||||
|
||||
if (pending.length === 0) {
|
||||
console.log('No merged release PR is pending - nothing to reconcile.')
|
||||
return
|
||||
}
|
||||
|
||||
const failures = []
|
||||
|
||||
for (const pull of pending) {
|
||||
const mergeSha = pull.merge_commit_sha
|
||||
const headRef = pull.head?.ref ?? ''
|
||||
const branchGone = headRef.startsWith('refs/pull/') || headRef === ''
|
||||
const existingTag = tagSha.get(mergeSha)
|
||||
const labels = (pull.labels ?? []).map(label => label.name)
|
||||
|
||||
if (existingTag) {
|
||||
console.log(`#${pull.number}: ${existingTag} already points at merge commit ${mergeSha} - marking as tagged`)
|
||||
const next = labels.filter(name => name !== PENDING)
|
||||
if (!next.includes(TAGGED)) next.push(TAGGED)
|
||||
await replaceLabels(pull.number, next)
|
||||
continue
|
||||
}
|
||||
|
||||
if (!branchGone) {
|
||||
console.log(`#${pull.number}: head branch ${headRef} still exists - leaving it for release-please to tag`)
|
||||
continue
|
||||
}
|
||||
|
||||
// The branch is gone and no tag exists, so release-please will never get
|
||||
// past `Bad branch name` for this PR. Recreate the tag it should have
|
||||
// made, using the version the merged release PR wrote into the manifest.
|
||||
try {
|
||||
const version = await versionAt(mergeSha)
|
||||
if (!version) throw new Error('manifest has no version for the root package')
|
||||
const name = `v${version}`
|
||||
if (tagsByName.has(name)) {
|
||||
throw new Error(`${name} already exists at ${tagsByName.get(name)}, not at merge commit ${mergeSha}; refusing to move a release tag`)
|
||||
}
|
||||
console.log(`#${pull.number}: head branch is gone (${headRef}) - creating ${name} at ${mergeSha}`)
|
||||
await createTag(name, mergeSha)
|
||||
const next = labels.filter(label => label !== PENDING)
|
||||
if (!next.includes(TAGGED)) next.push(TAGGED)
|
||||
await replaceLabels(pull.number, next)
|
||||
}
|
||||
catch (error) {
|
||||
failures.push(`#${pull.number}: ${error.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
if (failures.length > 0) {
|
||||
for (const failure of failures) console.error(`::error::${failure}`)
|
||||
console.error('::error::release-please state is unrecoverable automatically; repair the PR/tag by hand before the next release')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
console.error(`::error::${error.message}`)
|
||||
process.exit(1)
|
||||
})
|
||||
Reference in new issue
Block a user