Automate manifest.json version updates during release #9

Merged
deluan merged 6 commits from claude/automate-manifest-versioning-MJ9WM into main 2026-02-07 18:17:09 -07:00
Showing only changes of commit 63ab3ec57e - Show all commits
+16 -8
View File
1
@@ -17,9 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Validate version format
env:
VERSION: ${{ inputs.version }}
run: |
if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "::error::Invalid version format '${{ inputs.version }}'. Use X.X.X (e.g., 1.2.3)"
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "::error::Invalid version format '$VERSION'. Use X.X.X (e.g., 1.2.3)"
exit 1
fi
@@ -27,9 +29,11 @@ jobs:
uses: actions/checkout@v5
- name: Check tag does not already exist
env:
VERSION: ${{ inputs.version }}
run: |
if git ls-remote --tags origin "refs/tags/v${{ inputs.version }}" | grep -q .; then
echo "::error::Tag v${{ inputs.version }} already exists"
if git ls-remote --tags origin "refs/tags/v${VERSION}" | grep -q .; then
echo "::error::Tag v${VERSION} already exists"
exit 1
fi
copilot-pull-request-reviewer[bot] commented 2026-02-07 15:53:33 -07:00 (Migrated from github.com)
Review

This step runs git ls-remote ... origin ... before the repository is checked out, so it will fail with “not a git repository” / no origin remote. Move the “Check out code” step before this, or use the GitHub API to check for an existing tag.

This step runs `git ls-remote ... origin ...` before the repository is checked out, so it will fail with “not a git repository” / no `origin` remote. Move the “Check out code” step before this, or use the GitHub API to check for an existing tag.
@@ -42,14 +46,18 @@ jobs:
run: go test -race ./...
- name: Update manifest.json version
env:
VERSION: ${{ inputs.version }}
run: |
sed -i 's/"version": *"[^"]*"/"version": "${{ inputs.version }}"/' manifest.json
jq --arg v "$VERSION" '.version = $v' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
- name: Commit, tag, and push
env:
VERSION: ${{ inputs.version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add manifest.json
git commit --allow-empty -m "Release v${{ inputs.version }}"
git tag "v${{ inputs.version }}"
git push origin main "v${{ inputs.version }}"
git commit --allow-empty -m "Release v${VERSION}"
git tag "v${VERSION}"
git push origin main "v${VERSION}"