Skip to content
Merged
53 changes: 53 additions & 0 deletions .github/workflows/bump-version-beta.yml
Comment thread
VikramGoyal23 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Bump beta version tag

on:
workflow_dispatch:

Comment on lines +3 to +5
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch does not support a secrets: schema (only inputs:). As written, this won't actually enforce that ORG_PAT is provided, and the workflow may run and fail later with a confusing auth error. Consider removing this block and instead adding an early step that validates ${{ secrets.ORG_PAT }} is set (or use a protected environment with required reviewers/required secrets).

Copilot uses AI. Check for mistakes.
permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest

concurrency:
group: tag-development
cancel-in-progress: false

env:
PAT: ${{ secrets.ORG_PAT }}

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Compute next beta tag
id: version
run: |
git fetch --tags
STABLE=$(git tag --list "v*" \
| grep -Ev -- '-beta' \
| sort -V \
| tail -n 1)
STABLE=${STABLE:-v0.0.0}
BASE=${STABLE#v}
EXISTING=$(git tag -l "v$BASE-beta*" | sort -V | tail -n 1)
if [[ -z "$EXISTING" ]]; then
NEXT="v$BASE-beta.1"
else
NUM=$(echo "$EXISTING" | sed -E 's/.*beta\.?([0-9]*)/\1/')
NEXT="v$BASE-beta.$((NUM+1))"
fi
echo "next=$NEXT" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"

TAG=${{ steps.version.outputs.next }}

git tag "$TAG"

git push https://x-access-token:${PAT}@github.com/${{ github.repository }}.git refs/tags/$TAG
Loading
Loading