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

Failed to publish #78

Closed
alexbeletsky opened this issue Apr 13, 2023 · 2 comments
Closed

Failed to publish #78

alexbeletsky opened this issue Apr 13, 2023 · 2 comments
Labels
question Further information is requested

Comments

@alexbeletsky
Copy link

I've started to receive that error,

Run JS-DevTools/npm-publish@v1
  with:
    token: ***
    access: restricted
    registry: https://registry.npmjs.org/
    package: package.json
    dry-run: false
    check-version: true
Error: Error: Unable to read the NPM config file: /home/runner/.npmrc 
EISDIR: illegal operation on a directory, read
    at readNpmConfig (/home/runner/work/_actions/JS-DevTools/npm-publish/v1/src/npm-config.ts:8[7](https://github.com/blogfoster/query-mapper/actions/runs/4688157894/jobs/8308328076#step:10:7):11)

Error: EISDIR: illegal operation on a directory, read

Actions file

name: Check, Test & Publish

on:
  push:
    tags:
      - '*'
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Setup node.js
        uses: actions/setup-node@v3
        with:
          node-version: 12

      - name: Publish to NPM
        uses: JS-DevTools/npm-publish@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          token: ${{ secrets.NPM_TOKEN }}
          tag: ${{ github.event.release.tag_name }}
          access: restricted

Any ideas?

@mcous
Copy link
Member

mcous commented Apr 13, 2023

@alexbeletsky are you able to post a link to the repository where this is happening, or is it private? You also mentioned (emphasis mine):

I've started to receive that error

This action has not changed anything on v1 for a few years, and it seems from your language like it was working previously. Given that nothing changed on this action's end, is there anything in your setup that may have changed?

This action both reads and writes the ~/.npmrc config file, but it looks like in your setup ~/.npmrc is a directory - EISDIR == "Error, is a directory". I have no clue what would cause this, but I'm almost certain no code in this action (intentionally) creates a directory at that path.

As a debugging step, either one or both of the commands in your runner might shed some light on the situation:

  • npm config ls -l
  • ls -apl ${HOME}

You could also try using this action from the latest development commit rather than the v1 tag, but I wouldn't expect this to help if something is actually causing ~/.npmrc to be a directory.

# caution: not yet released, will become v2
uses: JS-DevTools/npm-publish@1641d030cee266f093503c555ee9303ae7aede16

You could also try adding the registryUrl setting to the setup node action. It might be able to work around whatever's going on, but at best that'd be a bandaid.

@mcous mcous added the question Further information is requested label Apr 13, 2023
@mcous
Copy link
Member

mcous commented Apr 20, 2023

v2 of this action has just been released, and it no longer reads ~/.npmrc. I still suspect an issue with your setup, but this action should no longer be susceptible to this particular problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants