Skip to content

Commit 03ae187

Browse files
fix(ci): scope nightly targets and gate api-tag/release-PR to stable
nightly-rc.yaml's `release-[0-9]*.[0-9]*` glob also matched the per-tag staging branches tags.yaml creates (release-1.4.0, release-1.4.0-rc.2, release-1.5.0-nightly.<date>), cutting spurious nightly tags. Anchor the target selection with a `^release-[0-9]+\.[0-9]+$` regex. tags.yaml now exposes an is_stable output and gates the write-once api/apps/v1alpha1 Go-module tag and the auto-opened release PR on it, so an rc/beta/alpha (is_stable=false) or a nightly (is_stable unset) never pollutes the module proxy or opens a release PR (#2677 goal 3). Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent f2fcd40 commit 03ae187

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎.github/workflows/nightly-rc.yaml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ jobs:
5555
# Tracked targets: main + every release-X.Y maintenance branch.
5656
targets="main"
5757
for b in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin/release-* 2>/dev/null); do
58-
case "$b" in
59-
origin/release-[0-9]*.[0-9]*) targets="$targets ${b#origin/}" ;;
60-
esac
58+
br="${b#origin/}"
59+
# Only exact two-component maintenance branches (release-X.Y). A bare
60+
# shell glob also matches the per-tag staging branches tags.yaml
61+
# creates (release-1.4.0, release-1.4.0-rc.2, release-1.5.0-nightly.<date>),
62+
# so anchor with a regex to drop them.
63+
printf '%s\n' "$br" | grep -qE '^release-[0-9]+\.[0-9]+$' && targets="$targets $br"
6164
done
6265
6366
# Highest vX.Y.Z stable tag (ignores prereleases) for next-version math.

‎.github/workflows/tags.yaml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
core.setOutput('tag', ref); // v0.31.5-rc.1
8080
core.setOutput('version', version); // 0.31.5-rc.1
8181
core.setOutput('is_rc', isRc); // true
82+
core.setOutput('is_stable', !isRc); // true only for a plain vX.Y.Z
8283
core.setOutput('line', `${maj}.${min}`); // 0.31
8384
8485
# Detect base branch (main or release-X.Y) the tag was pushed from
@@ -150,8 +151,12 @@ jobs:
150151
# pkg.go.dev, where a moved tag poisons caches irreversibly. Create the tag
151152
# only when absent; if it already points at the same commit, no-op; if it
152153
# exists pointing elsewhere, fail loudly rather than force-move it.
154+
# Stable releases only: an immutable Go-module tag must never be cut for an
155+
# rc/beta/alpha (is_stable=false) or a nightly (is_stable unset — Parse tag
156+
# rejects -nightly before this), which would permanently pollute the module
157+
# proxy with a prerelease version (#2677 goal 3).
153158
- name: Tag API submodule (write-once)
154-
if: steps.check_release.outputs.skip == 'false'
159+
if: steps.check_release.outputs.skip == 'false' && steps.tag.outputs.is_stable == 'true'
155160
env:
156161
APP_TOKEN: ${{ steps.app-token.outputs.token }}
157162
VTAG: ${{ steps.tag.outputs.tag }}
@@ -241,9 +246,10 @@ jobs:
241246
git push -f origin "HEAD:refs/heads/${BRANCH}"
242247
fi
243248
244-
# Create pull request into original base branch (if absent)
249+
# Create pull request into original base branch (if absent). Stable only —
250+
# an rc/nightly must not auto-open a release PR (#2677 goal 3).
245251
- name: Create pull request if not exists
246-
if: steps.check_release.outputs.skip == 'false'
252+
if: steps.check_release.outputs.skip == 'false' && steps.tag.outputs.is_stable == 'true'
247253
uses: actions/github-script@v7
248254
with:
249255
github-token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)