question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

${{ github.action_path }} makes no sense when action is run inside self-hosted custom container.

See original GitHub issue

Describe the bug ${{ github.action_path }} points to a location in the host filesystem of the github runner host. Not to /__w/_actions/…

To Reproduce Steps to reproduce the behavior:

  1. Create a custom container.
  2. Create a workflow that uses the custom docker container on a self-hosted runner.
  3. Try to follow the guide for the new composite actions that requires to use ${{ github.action_path }}, for example to locate a shell script of a composite action.

Expected behavior The shell script is found and executed, just like when doing this with a normal ubuntu-latest runner.

Runner Version and Platform

v2.273.4 on Linux.

OS of the machine running the runner? OSX/Windows/Linux/… Linux.

What’s not working?

(...)
##[error]Process completed with exit code 127.
Run pylot-tech/actions_checkout@v1
/__w/_temp/615e5631-1155-478e-93e8-8e5cc51fb88e.sh: line 1: /home/github-runner/actions-runner-new/_work/_actions/pylot-tech/actions_checkout/v1/clone.sh: No such file or directory

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:17
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
zotrixcommented, Mar 10, 2021

seems like env variable GITHUB_ACTION_PATH set to correct path. so step could be called via GITHUB_ACTION_PATH instead of ${{ github.action_path }}

  - run: ${GITHUB_ACTION_PATH}/setup.sh
    shell: sh
4reactions
vstrimaitiscommented, Feb 1, 2023

Hi! I’m still encountering this issue in the following case:

  1. Create a custom composite action foo in a (private) repository A. The action is defined using two files - foo/action.yml and foo/my_script.sh; action.yml references the script like so: run: ${{ github.action_path }}/my_script.sh
  2. Create a workflow in repository B that does the following:
    1. Pulls down repository A using actions/checkout to a local folder
    2. Invokes the custom action using uses: ./my_local_folder/foo
  3. Get the same <...> No such file or directory <...> error as mentioned in the issue’s description

Using ${GITHUB_ACTION_PATH} instead of ${{ github.action_path }} does help by the way, but I guess the two placeholders should behave the same way? 😁

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run the job.container as the same user of the host VM by ...
Description Run the containers as the same user running on the host (the ... github.action_path }} makes no sense when action is run...
Read more >
github.action_path contains wrong path when used inside ...
When using ${{ github.action_path }} inside a local composite action and calling this action in a job that runs inside a container, ...
Read more >
Customizing the containers used by jobs
GitHub Actions supports commands that let you customize the way your containers are created by the self-hosted runner. For example, you can use...
Read more >
Workflow syntax for GitHub Actions
A workflow with the following path filter will only run on push events that include at least one file outside the docs directory...
Read more >
Contexts - GitHub Docs
Contexts are a way to access information about workflow runs, variables, runner environments, jobs, and steps. Each context is an object that contains ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found