File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : npm publish
1+ name : npm- publish.yml
22
33on :
44 release :
@@ -97,10 +97,12 @@ jobs:
9797 echo "package.json repository.url = $REPO"
9898 test "$REPO" = "git+https://github.com/albe/node-event-storage.git" \
9999 || { echo "ERROR: repository.url must be git+https://github.com/albe/node-event-storage.git for npm OIDC trusted publishing"; exit 1; }
100- - name : " Preflight: show ref + version"
100+ - name : " Preflight: validate version"
101101 run : |
102102 echo "GITHUB_REF=$GITHUB_REF"
103- git describe --tags --always
104- node -p "require('./package.json').version"
103+ VERSION="$(node -p "require('./package.json').version")"
104+ TAG="${{ inputs.tag || github.event.release.tag_name }}"
105+ echo "tag=$TAG version=$VERSION"
106+ test "v$VERSION" = "$TAG" || { echo "ERROR: Tag ($TAG) does not match package.json version (v$VERSION)"; exit 1; }
105107 - run : npm ci
106108 - run : npm publish --provenance --access public
You can’t perform that action at this time.
0 commit comments