Skip to content

Commit e3a4058

Browse files
tomymaritanoclaude
andauthored
ci: add auto-tag workflow missing from main (#153)
## Summary - Adds `auto-tag.yml` workflow that was created during v0.9.0 development but missed the squash merge to main - Without this workflow, release PRs don't trigger automatic tag creation, breaking the release pipeline ## Context The release pipeline chain is: `release/* PR merge → auto-tag creates vX.Y.Z → release.yml builds + publishes` This workflow was in `release/0.9.0` but the squash merge of PR #149 didn't include it, so v0.9.0 never got tagged or released. ## After merge Once this is on main, I'll manually create the `v0.9.0` tag to trigger the release build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c128676 commit e3a4058

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/auto-tag.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Auto Tag & Sync
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches: [main]
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
tag-and-sync:
13+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout main
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.GH_TOKEN }}
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Read version from package.json
27+
id: version
28+
run: |
29+
VERSION=$(node -p "require('./package.json').version")
30+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
31+
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
32+
33+
- name: Check tag doesn't already exist
34+
id: check
35+
env:
36+
TAG_VERSION: ${{ steps.version.outputs.version }}
37+
run: |
38+
if git rev-parse "v${TAG_VERSION}" >/dev/null 2>&1; then
39+
echo "exists=true" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "exists=false" >> "$GITHUB_OUTPUT"
42+
fi
43+
44+
- name: Create and push tag
45+
if: steps.check.outputs.exists == 'false'
46+
env:
47+
TAG_NAME: ${{ steps.version.outputs.tag }}
48+
run: |
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
git tag -a "${TAG_NAME}" -m "Release ${TAG_NAME}"
52+
git push origin "${TAG_NAME}"
53+
54+
- name: Merge main → develop
55+
run: |
56+
git fetch origin develop
57+
git checkout develop
58+
git merge main --no-edit
59+
git push origin develop

0 commit comments

Comments
 (0)