Skip to content

Not using version from package.json #38

Closed
@CWSites

Description

@CWSites

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 }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions