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 995f5737fc - Show all commits
+54
View File
@@ -0,0 +1,54 @@
name: Create Release
copilot-pull-request-reviewer[bot] commented 2026-02-07 15:53:34 -07:00 (Migrated from github.com)
Review

git commit -m "Release v..." will fail the workflow if manifest.json already contains the requested version (nothing to commit), which can happen if the workflow is re-run or the input matches the current version. Consider guarding with a diff check and skipping the commit when unchanged, or adding --allow-empty if an empty release commit is acceptable.

                  git commit --allow-empty -m "Release v${{ inputs.version }}"
`git commit -m "Release v..."` will fail the workflow if `manifest.json` already contains the requested version (nothing to commit), which can happen if the workflow is re-run or the input matches the current version. Consider guarding with a diff check and skipping the commit when unchanged, or adding `--allow-empty` if an empty release commit is acceptable. ```suggestion git commit --allow-empty -m "Release v${{ inputs.version }}" ```
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., 1.2.3, without the 'v' prefix)"
required: true
type: string
permissions:
contents: write
jobs:
create-release:
name: Create Release Tag
runs-on: ubuntu-latest
steps:
- name: Validate version format
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)"
exit 1
fi
- name: Check tag does not already exist
run: |
if git ls-remote --tags origin "refs/tags/v${{ inputs.version }}" | grep -q .; then
echo "::error::Tag v${{ inputs.version }} already exists"
exit 1
fi
- name: Check out code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v5
with:
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.
go-version-file: go.mod
- name: Run tests
run: go test -race ./...
- name: Update manifest.json version
run: sed -i 's/"version": *"[^"]*"/"version": "${{ inputs.version }}"/' manifest.json
- name: Commit, tag, and push
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 -m "Release v${{ inputs.version }}"
git tag "v${{ inputs.version }}"
git push origin main "v${{ inputs.version }}"