diff --git a/workflow-templates/npm-publish.yml b/workflow-templates/npm-publish.yml index 0e0cd437..dc5143ba 100644 --- a/workflow-templates/npm-publish.yml +++ b/workflow-templates/npm-publish.yml @@ -49,6 +49,17 @@ jobs: - name: Set up npm ${{ steps.versions.outputs.npmVersion }} run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Check tag matches package.json + run: | + VERSION=$(node -p -e "require('./package.json').version") + GH_VERSION=$(echo "$GH_VERSION" | sed s,\^v,,) + if [ "$VERSION" != "$GH_VERSION" ]; then + echo "$VERSION does not match $GH_VERSION" + exit 1; + fi; + env: + GH_VERSION: ${{ github.event.release.tag_name }} + - name: Install dependencies & build env: CYPRESS_INSTALL_BINARY: 0