Skip to content

Commit 218efca

Browse files
authored
fix(ci): publish when the release PR merges, not when a changeset lands (#8)
changesets/action runs `changeset version` in the working directory before it pushes the release branch, so the publish step that follows it in the same job sees a tree that is already bumped. 0.2.0 went out the moment #6 merged, while its release PR was still open - and that PR's own run then had nothing left to do. Gating on `has-changesets` puts the release back behind the merge.
1 parent e5168f0 commit 218efca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
run: echo "date=$(date -u +'%Y-%m-%d %H:%M:%S')" >> "$GITHUB_OUTPUT"
3636

3737
- name: Attempt to release
38+
id: changesets
3839
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
3940
env:
4041
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -43,6 +44,7 @@ jobs:
4344
commit-message: "chore: release ${{ steps.date.outputs.date }}"
4445

4546
- name: Publish packages
47+
if: steps.changesets.outputs.has-changesets == 'false'
4648
run: >
4749
pnpm --recursive --filter "./packages/*" publish
4850
--no-git-checks --access public

0 commit comments

Comments
 (0)