summaryrefslogtreecommitdiff
path: root/.github/workflows/tag-release.yaml
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-04-10 17:43:15 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-04-10 17:55:18 +0300
commit6c85123a3a38a28d06089901c0b5c08e4782de58 (patch)
treee5dea08711ddc1faf4821bae000bd58c9ac6f498 /.github/workflows/tag-release.yaml
parentf5908eddc683dd705d334c88377139e39bbfb54f (diff)
parent5c500ccf407f0b5a0b253b98dd4bd3f33f643aba (diff)
Merge remote-tracking branch 'origin/main' into marchcat/slua-26.1.1
# Conflicts: # .github/workflows/build.yaml # autobuild.xml # indra/cmake/Python.cmake # indra/newview/CMakeLists.txt # indra/newview/llappviewer.cpp # indra/newview/llappviewerwin32.cpp # indra/newview/llpanellogin.cpp
Diffstat (limited to '.github/workflows/tag-release.yaml')
-rw-r--r--.github/workflows/tag-release.yaml36
1 files changed, 28 insertions, 8 deletions
diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml
index 2922065f99..0f826222a0 100644
--- a/.github/workflows/tag-release.yaml
+++ b/.github/workflows/tag-release.yaml
@@ -21,7 +21,9 @@ on:
project:
description: "Project Name (used for channel name in project builds, and tag name for all builds)"
default: "hippo"
- # TODO - add an input for selecting another sha to build other than head of branch
+ tag_override:
+ description: "Override the tag name (optional). If the tag already exists, a numeric suffix is appended."
+ required: false
jobs:
tag-release:
@@ -34,7 +36,7 @@ jobs:
NIGHTLY_DATE=$(date --rfc-3339=date)
echo NIGHTLY_DATE=${NIGHTLY_DATE} >> ${GITHUB_ENV}
echo TAG_ID="$(echo ${{ github.sha }} | cut -c1-8)-${{ inputs.project || '${NIGHTLY_DATE}' }}" >> ${GITHUB_ENV}
- - name: Update Tag
+ - name: Create Tag
uses: actions/github-script@v8
with:
# use a real access token instead of GITHUB_TOKEN default.
@@ -44,9 +46,27 @@ jobs:
# this token will need to be renewed anually in January
github-token: ${{ secrets.LL_TAG_RELEASE_TOKEN }}
script: |
- github.rest.git.createRef({
- owner: context.repo.owner,
- repo: context.repo.repo,
- ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}",
- sha: context.sha
- })
+ const override = `${{ inputs.tag_override }}`.trim();
+ const baseTag = override || `${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}`;
+
+ // Try the base tag first, then append -2, -3, etc. if it already exists
+ let tag = baseTag;
+ for (let attempt = 1; ; attempt++) {
+ try {
+ await github.rest.git.createRef({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: `refs/tags/${tag}`,
+ sha: context.sha
+ });
+ core.info(`Created tag: ${tag}`);
+ break;
+ } catch (e) {
+ if (e.status === 422 && attempt < 10) {
+ core.info(`Tag '${tag}' already exists, trying next suffix...`);
+ tag = `${baseTag}-${attempt + 1}`;
+ } else {
+ throw e;
+ }
+ }
+ }