Skip to content

Commit 21e6039

Browse files
authored
Merge pull request #280 from knockout/pc/release_tagging
Change release trigger from main push to tags
2 parents 42382af + 5590e15 commit 21e6039

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Automated release via Changesets.
22
#
3-
# On push to main:
3+
# On tagging:
44
# - If there are unreleased changesets, opens/updates a release version
55
# PR that bumps versions and updates changelogs.
66
# - If there are no unreleased changesets, builds, tests, and publishes
@@ -12,7 +12,8 @@ name: Release
1212

1313
on:
1414
push:
15-
branches: [main]
15+
tags:
16+
- 'v*'
1617

1718
concurrency: ${{ github.workflow }}-${{ github.ref }}
1819

@@ -101,6 +102,18 @@ jobs:
101102
version="$(node tools/release-version.cjs)"
102103
echo "version=$version" >> "$GITHUB_OUTPUT"
103104
105+
- name: Validate tag matches release version
106+
env:
107+
TAG_VERSION: ${{ github.ref_name }}
108+
RELEASE_VERSION: ${{ steps.version.outputs.version }}
109+
run: |
110+
tag_version="${TAG_VERSION#v}"
111+
112+
if [ "$tag_version" != "$RELEASE_VERSION" ]; then
113+
echo "Tag version $tag_version does not match release version $RELEASE_VERSION." >&2
114+
exit 1
115+
fi
116+
104117
- name: Build all packages
105118
run: make
106119

0 commit comments

Comments
 (0)