summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/update-version-tags.yml42
-rw-r--r--context7.json4
2 files changed, 44 insertions, 2 deletions
diff --git a/.github/workflows/update-version-tags.yml b/.github/workflows/update-version-tags.yml
new file mode 100644
index 00000000..eb87f801
--- /dev/null
+++ b/.github/workflows/update-version-tags.yml
@@ -0,0 +1,42 @@
+name: Update version tags
+
+on:
+ push:
+ branches:
+ - current
+ - circinus
+ - sagitta
+
+permissions:
+ contents: write
+
+concurrency:
+ group: version-tag-${{ github.ref_name }}
+ cancel-in-progress: true
+
+jobs:
+ retag:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Move version tag to pushed SHA
+ env:
+ GH_TOKEN: ${{ github.token }}
+ REPO: ${{ github.repository }}
+ SHA: ${{ github.sha }}
+ BRANCH: ${{ github.ref_name }}
+ run: |
+ set -euo pipefail
+ case "$BRANCH" in
+ current) TAG=rolling ;;
+ circinus) TAG=1.5 ;;
+ sagitta) TAG=1.4 ;;
+ *) echo "Unexpected branch: $BRANCH" >&2; exit 1 ;;
+ esac
+ echo "Pointing tag '$TAG' at $SHA (branch $BRANCH)"
+ if gh api "repos/$REPO/git/ref/tags/$TAG" >/dev/null 2>&1; then
+ gh api -X PATCH "repos/$REPO/git/refs/tags/$TAG" \
+ -f sha="$SHA" -F force=true
+ else
+ gh api -X POST "repos/$REPO/git/refs" \
+ -f ref="refs/tags/$TAG" -f sha="$SHA"
+ fi
diff --git a/context7.json b/context7.json
index 92eea80b..62d04b59 100644
--- a/context7.json
+++ b/context7.json
@@ -30,7 +30,7 @@
"Use reserved documentation IP space in examples: 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 (RFC 5737), 2001:db8::/32 (RFC 3849). Never use real or RFC1918 addresses."
],
"previousVersions": [
- { "branch": "circinus" },
- { "branch": "sagitta" }
+ { "tag": "1.5" },
+ { "tag": "1.4" }
]
}