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

directory_md action: failing with python: can't open file '.../build_directory_md.py': [Errno 2] No such file or directory #27

Closed
vzvu3k6k opened this issue Jun 24, 2023 · 2 comments · Fixed by #33
Labels
bug Something isn't working

Comments

@vzvu3k6k
Copy link

We tried to introduce TheAlgorithms/scripts/directory_md into TheAlgorithms/Ruby with TheAlgorithms/Ruby#209, but after the merge it failed to run with the following error:

python: can't open file '/home/runner/work/Ruby/Ruby/build_directory_md.py': [Errno 2] No such file or directory
GitHub Action log
  • https://github.com/TheAlgorithms/Ruby/actions/runs/5337370931/jobs/9673337632
  • Excerpt:
    # Build Directory step
    Run TheAlgorithms/scripts/directory_md@main
      with:
        language: Ruby
        working-directory: .
        filetypes: .rb
        branch-name: directory-update
    Run echo "/home/runner/work/_actions/TheAlgorithms/scripts/main/directory_md" >> $GITHUB_PATH
      echo "/home/runner/work/_actions/TheAlgorithms/scripts/main/directory_md" >> $GITHUB_PATH
      shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
    Run actions/setup-python@v4
      with:
        python-version: 3.x
        check-latest: false
        token: ***
        update-environment: true
        allow-prereleases: false
    Installed versions
      Successfully set up CPython (3.11.4)
    Run git config --global user.name github-actions[bot]
      git config --global user.name github-actions[bot]
      git config --global user.email 'github-actions@users.noreply.github.com'
      shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
      env:
        pythonLocation: /opt/hostedtoolcache/Python/3.11.4/x64
        PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib/pkgconfig
        Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib
    Run # If branch exists, change to that branch to prevent multiple committing/PR creation.
      # If branch exists, change to that branch to prevent multiple committing/PR creation.
      git checkout directory-update || true
      
      python build_directory_md.py Ruby . .rb   > DIRECTORY.md
      shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
      env:
        pythonLocation: /opt/hostedtoolcache/Python/3.11.4/x64
        PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib/pkgconfig
        Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.4/x64
        LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.4/x64/lib
    error: pathspec 'directory-update' did not match any file(s) known to git
    python: can't open file '/home/runner/work/Ruby/Ruby/build_directory_md.py': [Errno 2] No such file or directory
    Error: Process completed with exit code 2.
    

After discussing this with @Panquesito7 in the PR, it seems that the GitHub Action needs to be modified, so I am reporting it here. Thanks!

@Panquesito7
Copy link
Member

I believe the script needs to fetch the scripts if they do not exist, otherwise, it should keep it as-is.
The same happened to me in another action I'm using: the scripts need to be cloned into the given repository (in this case, the Ruby repository). They do not need to be committed, though, so that's fine.

CC: @tjgurwara99.
P.S.: Taj is already working on another tool to make these scripts much easier to use and integrate, but in the meantime, we should fix this ASAP.

tjgurwara99 added a commit that referenced this issue Jun 28, 2023
This is a patch to issue #27

To test this I need to whip up something
tjgurwara99 added a commit that referenced this issue Jul 3, 2023
This is a patch to issue #27

To test this I need to whip up something
@tjgurwara99
Copy link
Member

Looks like it's fixed - I'm closing this. If it appears again, let us know 🙏🏼

jenniferlb63 added a commit to jenniferlb63/Python-scripts that referenced this issue Aug 4, 2023
This is a patch to issue TheAlgorithms/scripts#27

To test this I need to whip up something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants