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

exception when using path #3497

Closed
kwavnet opened this issue Nov 14, 2024 · 3 comments
Closed

exception when using path #3497

kwavnet opened this issue Nov 14, 2024 · 3 comments

Comments

@kwavnet
Copy link

kwavnet commented Nov 14, 2024

With the following settings

Run peter-evans/[email protected]
  with:
    token: ***
    commit-message: data.json: update
  
    committer: Report Bot <[email protected]>
    author: Report Bot <[email protected]>
    path: data.json
    branch: update/data
    base: master
    delete-branch: true
    title: data.json: update
    body: Update the data.json file.
    labels: automerge
  
    draft: false
    signoff: false
    sign-commits: false
    maintainer-can-modify: true
  env:
    SSH_AUTH_SOCK: /tmp/ssh-XXXXXXgzrLGR/agent.1535
    SSH_AGENT_PID: 1536
    pythonLocation: /opt/hostedtoolcache/Python/3.10.15/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.15/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib

on a ubuntu-latest

I get

Prepare git configuration
  /usr/bin/git config --global --name-only --get-regexp safe.directory /home/runner/work/my-repo/my-repo/data.json
  node:internal/child_process:421
      throw new ErrnoException(err, 'spawn');
            ^
  
  Error: spawn ENOTDIR
      at ChildProcess.spawn (node:internal/child_process:421:11)
      at Object.spawn (node:child_process:761:9)
      at ToolRunner.<anonymous> (/home/runner/work/_actions/peter-evans/create-pull-request/v7.0.5/dist/index.js:3970:34)
      at Generator.next (<anonymous>)
      at fulfilled (/home/runner/work/_actions/peter-evans/create-pull-request/v7.0.5/dist/index.js:3581:58) {
    errno: -20,
    code: 'ENOTDIR',
    syscall: 'spawn'
  }
  
  Node.js v20.13.1

When I use add-path instead of path it just works.
I don't understand the internals, but it looks a bit like this here nodejs/node#52667 (comment)

@peter-evans
Copy link
Owner

Hi @kwavnet

The inputs path and add-paths have different functionality. Please see the description of the inputs here: https://github.com/peter-evans/create-pull-request#action-inputs

Based on your example, it looks like using add-paths is the correct approach for your use case.

@kwavnet
Copy link
Author

kwavnet commented Nov 14, 2024

Would a sanity check make sense here (path exists?)?
I was just confused by the exception, which didn't really point in that direction

@peter-evans
Copy link
Owner

Would a sanity check make sense here (path exists?)? I was just confused by the exception, which didn't really point in that direction

You're right, I could check if the path exists to avoid this confusing error. I'll add it to my todo list. 👍

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

2 participants