From 8d059d98445e4791ece81af40173ab10a1ae757b Mon Sep 17 00:00:00 2001 From: codfish Date: Sat, 14 Mar 2026 15:11:34 -0400 Subject: [PATCH] chore: auto-tag with latest json-server version --- .github/workflows/tag.yml | 44 +++++++++++++++++++++++++++++++++++++++ .gitignore | 4 ++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..aacff66 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,44 @@ +name: Auto Tag + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + auto-tag: + name: Auto-tag based on json-server version + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Create or update tag + run: | + VERSION=$(jq -r '.dependencies["json-server"]' package.json) + if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then + echo "Error: Could not extract json-server version from package.json" + exit 1 + fi + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + + echo "json-server version: $VERSION" + echo "Latest tag: $LATEST_TAG" + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + if [ "$LATEST_TAG" = "$VERSION" ]; then + echo "Tag $VERSION already exists, updating to current commit..." + git tag -fa "$VERSION" -m "Update $VERSION tag" + git push origin "$VERSION" --force + else + echo "Creating new tag $VERSION..." + git tag -a "$VERSION" -m "$VERSION" + git push origin "$VERSION" --force + fi diff --git a/.gitignore b/.gitignore index 266785a..30ae289 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,7 @@ typings/ .dynamodb/ dist + +.claude/* +!.claude/settings.json +!.claude/skills