Skip to content

.npmrc is not created #249

@adamhenson

Description

@adamhenson

Expected

When registry-url input is set with env.NODE_AUTH_TOKEN an .npmrc file should be created in project root.

Actual

When registry-url input is set with env.NODE_AUTH_TOKEN an .npmrc file is not created.

Reproduction

.github/workflows/publish.yml

name: Publish
on:
  push:
    branches:
      - master

jobs:
  publish:
    runs-on: ubuntu-latest
    env:
      NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
    steps:
      - uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: '12.x'
          registry-url: 'https://registry.npmjs.org'
          scope: '@foo-software'
      - name: Publish Packages
        run: |
          cat .npmrc

package.json

{
  "name": "root",
  "private": true,
  "keywords": [
    ...
  ],
  "scripts": {
    ...
  },
  "husky": {
    ...
  },
  "lint-staged": {
    ...
  },
  "devDependencies": {
    ...
  }
}

Note: My project is a Lerna based monorepo, so the above package.json has minimal fields. Perhaps, this functionality requires certain fields / values, but I'm not sure why and what those fields would be.

GitHub Action output and linked here.

Screen Shot 2021-03-31 at 11 03 29 PM

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