Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not using version from package.json #38

Closed
CWSites opened this issue May 17, 2021 · 1 comment
Closed

Not using version from package.json #38

CWSites opened this issue May 17, 2021 · 1 comment

Comments

@CWSites
Copy link

CWSites commented May 17, 2021

My GitHub Action automatically updates my package.json with the correct version number based on the changes that were done during that release. Recently I noticed that what is being published to NPM doesn't align with the version in my package.json.

Below is my workflow for deploying to NPM. This step is done after built, version bumped, changelog and a release created in GitHub. I've been able to verify that my version is bumping correctly and the changelog + GitHub is reflecting this.

I would expect that this deploy action would take it's version from package.json which is correct but it appears as if it's looking to npm and just bumping whatever is already there?

Deploy to NPM Workflow

name: Deploy to NPM

on:
  workflow_dispatch:
  repository_dispatch:
    types: [run-deploy-to-npm]

jobs:
  # https://github.com/marketplace/actions/npm-publish
  npm-publish:
    name: Publish Latest to NPM
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          ref: ${{ github.event.client_payload.sha }}

      - run: 'echo "SHA: ${{github.event.client_payload.sha }}"'

      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 10

      - name: Install dependencies
        run: yarn install

      - name: Build package
        run: yarn build

      - name: Publish to NPM
        uses: JS-DevTools/npm-publish@v1
        with:
          package: dist/libs/dot-components/package.json
          token: ${{ secrets.NPM_TOKEN }}
@CWSites
Copy link
Author

CWSites commented May 19, 2021

I figured out what was going on here, I changed my default branch to be develop instead of master so this action was taking the sha from the wrong branch.

@CWSites CWSites closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant