diff --git a/.github/workflows/publish-node.js.yml b/.github/workflows/publish-node.js.yml index e25d139..9fcfec8 100644 --- a/.github/workflows/publish-node.js.yml +++ b/.github/workflows/publish-node.js.yml @@ -13,14 +13,21 @@ jobs: steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.target_commitish }} - uses: actions/setup-node@v2 with: node-version: 16 cache: 'npm' - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Publish Package - uses: JS-DevTools/npm-publish@v1 + - run: git config --global user.name "GitHub CD bot" + - run: git config --global user.email "github-cd-bot@example.com" + - run: npm version ${{ github.event.release.tag_name }} + - uses: JS-DevTools/npm-publish@v1 with: token: ${{ secrets.NPM_TOKEN }} - tag: ${{ env.RELEASE_VERSION }} + + # push the version changes to GitHub + - run: git push + env: + # The secret is passed automatically. Nothing to configure. + github-token: ${{ secrets.GITHUB_TOKEN }}