Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,26 @@ jobs:
with:
fetch-depth: 0

- name: "🏷️ Create and push tag"
# The repo has "immutable releases" enabled, so publishing a release
# locks its tag to this commit: it can't be moved or deleted while the
# release exists, and the tag name can never be reused. Consumers that
# pin `@<tag>` therefore get SHA-pin guarantees. A bare tag is NOT
# protected — only tags attached to a published release are — so the
# tag is created BY the release (--target) rather than pushed first:
# there is never a window with an unprotected tag on origin.
- name: "🏷️ Publish immutable release"
id: tag
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
COMMIT_COUNT=$(git rev-list --count HEAD)
DATE=$(date -u +%Y%m%d)
TAG="1.${COMMIT_COUNT}.${DATE}"
git tag "$TAG"
git push origin "$TAG"
gh release create "$TAG" --target "$GITHUB_SHA" --title "$TAG" \
--notes "$(git log -1 --pretty=%s)"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "Created tag: $TAG"
echo "Released $TAG at $GITHUB_SHA"

- name: "📝 Write summary"
run: echo "Released tag \`${{ steps.tag.outputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ Use the `review_instructions` input to focus the review on what matters for your

#### Versioning

Every merge to `main` is tagged `1.<commit-count>.<yyyymmdd>` by
[`release.yml`](.github/workflows/release.yml). Consuming repos pin a release tag and bump
it deliberately — there is no floating tag, so a github-workflows release never changes a
consumer's review behaviour until that repo opts in.
Every merge to `main` is tagged `1.<commit-count>.<yyyymmdd>` and published as a GitHub
release by [`release.yml`](.github/workflows/release.yml). The repo has **immutable
releases** enabled, so a released tag can't be moved or deleted and its name can never be
reused — pinning `@<tag>` is as strong as pinning a SHA. Consuming repos pin a release tag
and bump it deliberately; there is no floating tag, so a github-workflows release never
changes a consumer's review behaviour until that repo opts in.

## Composite actions

Expand Down
Loading