Skip to content

Commit b5fd593

Browse files
authored
Merge branch 'main' into release-please--branches--main--components--iobroker-sync
2 parents e628f14 + 6101555 commit b5fd593

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/pr-title.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
cli
4949
deps
5050
docs
51+
release
5152
main
5253
requireScope: false
5354
# Only the trailing full stop is rejected. A lower-case rule was tried and

.github/workflows/release.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Release to npm
22

3-
# Manual only. There is no push/tag trigger on purpose: publishing is
4-
# irreversible (npm forbids re-using a version number, and unpublishing is
5-
# restricted), so it should never happen as a side effect of a commit.
3+
# Fires when release-please publishes a GitHub Release — that only happens when a
4+
# release pull request is merged, which is itself a deliberate act with the version
5+
# and changelog visible for review. So merging the release PR is the single action
6+
# that ships a version.
7+
#
8+
# Still dispatchable by hand, defaulting to a dry run, for re-publishing after a
9+
# failure or validating the tarball without shipping.
610
on:
11+
release:
12+
types: [published]
713
workflow_dispatch:
814
inputs:
915
dry_run:
@@ -63,7 +69,7 @@ jobs:
6369
fi
6470
6571
- name: Pack (dry run)
66-
if: inputs.dry_run
72+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}
6773
run: npm publish --dry-run
6874

6975
# No NODE_AUTH_TOKEN. Publishing uses npm trusted publishing (OIDC): npm
@@ -74,13 +80,12 @@ jobs:
7480
#
7581
# Provenance is automatic under OIDC for a public package from a public repo,
7682
# so --provenance is not passed explicitly.
83+
# On a release event inputs.dry_run is undefined, so this must not rely on
84+
# negating it — an undefined input would otherwise read as "not a dry run"
85+
# by luck rather than intent.
7786
- name: Publish
78-
if: ${{ !inputs.dry_run }}
87+
if: ${{ github.event_name == 'release' || !inputs.dry_run }}
7988
run: npm publish --access public
8089

81-
- name: Tag the released commit
82-
if: ${{ !inputs.dry_run }}
83-
run: |
84-
VERSION=$(node -p "require('./package.json').version")
85-
git tag "v$VERSION"
86-
git push origin "v$VERSION"
90+
# No tagging step: release-please already created the tag and the GitHub
91+
# Release that triggered this run.

0 commit comments

Comments
 (0)