diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 5bf478d..381c5d2 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -10,7 +10,9 @@ name: auto-release # user-pushed tag fires release.yml, the manual path). To skip a release for a # trivial merge, put [skip release] in the PR title (the squash subject) — the # check reads only the subject line, so mentioning it in a PR/commit body (as -# this very comment does) does not trip it. +# this very comment does) does not trip it. Docs-only merges (only Markdown, +# docs/, or image assets changed) skip the release automatically — no marker +# needed. on: push: branches: [main] @@ -41,6 +43,20 @@ jobs: echo "[skip release] in the commit subject — no release cut." exit 0 fi + # Docs-only merges never cut a release, even without the marker: if + # every file this merge changed is documentation (Markdown, docs/, or + # an image asset), there's no app change to version. Count comparison + # (not grep -qv) to stay portable across BSD/GNU grep. + changed="$(git diff --name-only HEAD^ HEAD)" + if [ -n "$changed" ]; then + total=$(printf '%s\n' "$changed" | wc -l | tr -d ' ') + docs=$(printf '%s\n' "$changed" | grep -Ec '(\.md$|^docs/|\.(gif|png|jpe?g|webp|svg)$)' || true) + if [ "$total" = "$docs" ]; then + echo "Docs-only merge — no release cut. Changed files:" + printf '%s\n' "$changed" + exit 0 + fi + fi # Idempotent: if this commit is already tagged (re-run, or a manual # release just landed), there's nothing to cut. if existing=$(git describe --tags --exact-match HEAD 2>/dev/null); then