From 48c1a16762cef8d070fd85c21f4b37bc8c7b6167 Mon Sep 17 00:00:00 2001 From: floriankirmaier Date: Sun, 14 Jun 2026 01:51:58 +0200 Subject: [PATCH] tagRelease.sh: require project name as first arg (wrong-repo guard) Co-Authored-By: Claude Opus 4.8 (1M context) --- RELEASING.md | 3 ++- tagRelease.sh | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 71ab5ed..d7b6533 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -9,9 +9,10 @@ The version is **derived from git tags** — it exists nowhere in the repository ## Releasing a version ```bash -./tagRelease.sh 0.1.0 +./tagRelease.sh ai-docs 0.1.0 ``` +The first argument is the project name, guarding against running this in the wrong repo. The script only tags: it verifies a clean tree on an up-to-date `main`, then tags and pushes `v0.1.0` — no publishing happens locally. The tag push triggers `.github/workflows/release.yml`, which builds, tests, and runs the publish scripts: diff --git a/tagRelease.sh b/tagRelease.sh index 223d14e..c0eda44 100755 --- a/tagRelease.sh +++ b/tagRelease.sh @@ -3,9 +3,16 @@ # The tag push triggers .github/workflows/release.yml, which builds and publishes. set -e -VERSION=$1 +# First arg is the project name, guarding against running this in the wrong repo. +PROJECT="ai-docs" +if [ "$1" != "$PROJECT" ]; then + echo "usage: ./tagRelease.sh $PROJECT X.Y.Z" + exit 1 +fi + +VERSION=$2 if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "usage: ./tagRelease.sh X.Y.Z" + echo "usage: ./tagRelease.sh $PROJECT X.Y.Z" exit 1 fi