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

Issue: The name of the repo is duplicated in github.action_path #708

Closed
anka-213 opened this issue May 27, 2021 · 1 comment · Fixed by #712
Closed

Issue: The name of the repo is duplicated in github.action_path #708

anka-213 opened this issue May 27, 2021 · 1 comment · Fixed by #712
Labels
kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)

Comments

@anka-213
Copy link

Act version

8a9167da82b3824272fdbfcc25b3671cd1260e7d

(As of writing this issue, the latest commit on master)

Expected behaviour

The variable ${{ github.action_path }} should contain the actual path of the cloned repo.

Actual behaviour

The repo of the action is cloned to

/var/run/act/actions/nixbuild-nix-quick-install-action@v5

but the variable ${{ github.action_path }} contains

/var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/

so we get the error

/var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/nix-quick-install.sh: No such file or directory

Workflow and/or repository

name: example workflow
on: [push]

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: nixbuild/nix-quick-install-action@v5

Steps to reproduce

  1. Put the above workflow in .github/workflows/example.yaml
  2. Run act -W .github/workflows/example.yaml

act output

Short Log
[example workflow/example] 🚀  Start image=node:12.20.1-buster-slim
[example workflow/example]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[example workflow/example]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[example workflow/example] ⭐  Run nixbuild/nix-quick-install-action@v5
INFO[0000]   ☁  git clone 'https://github.com/nixbuild/nix-quick-install-action' # ref=v5 
[example workflow/example]   🐳  docker cp src=/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ dst=/var/run/act/actions/nixbuild-nix-quick-install-action@v5/
[example workflow/example]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/nixbuild-nix-quick-install-action@v5/] user=
[example workflow/example]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/anka/projekt/gf-lsp/workflow/composite-0.sh] user=
| /Users/anka/projekt/gf-lsp/workflow/composite-0.sh: line 1: /var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/nix-quick-install.sh: No such file or directory
[example workflow/example]   ❌  Failure - nixbuild/nix-quick-install-action@v5
Error: exit with `FAILURE`: 127
Verbose Log
[example workflow/example] 🚀  Start image=node:12.20.1-buster-slim
[example workflow/example]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[example workflow/example]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[example workflow/example] ⭐  Run nixbuild/nix-quick-install-action@v5
INFO[0000]   ☁  git clone 'https://github.com/nixbuild/nix-quick-install-action' # ref=v5 
[example workflow/example]   🐳  docker cp src=/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ dst=/var/run/act/actions/nixbuild-nix-quick-install-action@v5/
[example workflow/example]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/nixbuild-nix-quick-install-action@v5/] user=
[example workflow/example]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/anka/projekt/gf-lsp/workflow/composite-0.sh] user=
| /Users/anka/projekt/gf-lsp/workflow/composite-0.sh: line 1: /var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/nix-quick-install.sh: No such file or directory
[example workflow/example]   ❌  Failure - nixbuild/nix-quick-install-action@v5
Error: exit with `FAILURE`: 127
~/projekt/gf-lsp main*
❯ act -v -W .github/workflows/example.yaml
DEBU[0000] Loading environment from /Users/anka/projekt/gf-lsp/.env 
DEBU[0000] Loading secrets from /Users/anka/projekt/gf-lsp/.secrets 
DEBU[0000] Loading workflow '/Users/anka/projekt/gf-lsp/.github/workflows/example.yaml' 
DEBU[0000] Reading workflow '/Users/anka/projekt/gf-lsp/.github/workflows/example.yaml' 
DEBU[0000] Correcting if statements '/Users/anka/projekt/gf-lsp/.github/workflows/example.yaml' 
DEBU[0000] Planning event: push                         
DEBU[0000] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0000] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] context env => map[ACT:true]                 
[example workflow/example] 🚀  Start image=node:12.20.1-buster-slim
DEBU[0000] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0000] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0000] using github ref: refs/heads/main            
[example workflow/example]   🐳  docker pull node:12.20.1-buster-slim
DEBU[0000] Image exists? true                           
[example workflow/example] Removed container: f2bcecd08fc9b84ba61fd23d80d41baaec60016af5a8ff51bb8a264361c33e30
[example workflow/example]   🐳  docker volume rm act-example-workflow-example
[example workflow/example]   🐳  docker create image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[example workflow/example] Created container name=act-example-workflow-example id=aaf9ba87fc768e47c6af7c726e42a729d206f612d2bae9872b167ef22cadf0e4 from image node:12.20.1-buster-slim (platform: )
[example workflow/example] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[example workflow/example]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[example workflow/example] Starting container: aaf9ba87fc768e47c6af7c726e42a729d206f612d2bae9872b167ef22cadf0e4
[example workflow/example] Started container: aaf9ba87fc768e47c6af7c726e42a729d206f612d2bae9872b167ef22cadf0e4
[example workflow/example]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[example workflow/example] Exec command '[mkdir -m 0777 -p /var/run/act]'
DEBU[0000] Writing entry to tarball workflow/event.json len:2 
DEBU[0000] Writing entry to tarball workflow/envs.txt len:0 
DEBU[0000] Writing entry to tarball workflow/paths.txt len:0 
[example workflow/example] Extracting content to '/var/run/act/'
DEBU[0000] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0000] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0000] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] context env => map[ACT:true]                 
DEBU[0000] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:example GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:anka-213/gf-lsp GITHUB_REPOSITORY_OWNER:anka-213 GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3583868e9aafc074c799726bc83bcac854187c85 GITHUB_TOKEN: GITHUB_WORKFLOW:example workflow GITHUB_WORKSPACE:/Users/anka/projekt/gf-lsp ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:] 
[example workflow/example] setupEnv => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:example GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:anka-213/gf-lsp GITHUB_REPOSITORY_OWNER:anka-213 GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3583868e9aafc074c799726bc83bcac854187c85 GITHUB_TOKEN: GITHUB_WORKFLOW:example workflow GITHUB_WORKSPACE:/Users/anka/projekt/gf-lsp ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:]
[example workflow/example] ⭐  Run nixbuild/nix-quick-install-action@v5
DEBU[0000] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0000] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0000] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0000] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0000] using github ref: refs/heads/main            
INFO[0000]   ☁  git clone 'https://github.com/nixbuild/nix-quick-install-action' # ref=v5 
DEBU[0000]   cloning https://github.com/nixbuild/nix-quick-install-action to /Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5 
DEBU[0001] Cloned https://github.com/nixbuild/nix-quick-install-action to /Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5 
DEBU[0001] Checked out v5                               
DEBU[0001] Read action &{Nix Quick Install Rickard Nilsson Quickly installs Nix in unprivileged single-user mode map[nix_archives_url:{Don't use. For bootstrapping purposes only.
 false } nix_conf:{If set, this configuration is written to a new file which is then added to
the NIX_USER_CONF_FILES environment variable. You can also set that
variable yourself to control the Nix configuration.
 false } nix_version:{The version of Nix that should be installed

If not specified, the latest stable Nix release is used. Note that each
release of nix-quick-install-action has a specific set of supported
Nix versions, which do not change. You can check what Nix versions are
supported by the version of nix-quick-install-action you're using by
going to https://github.com/nixbuild/nix-quick-install-action/releases
 true 2.3.10}] map[] {composite map[]   [] [] [{ {0 0    <nil> []    0 0} Install Nix in single-user mode  ${{ github.action_path }}/nix-quick-install.sh  bash map[NIX_ARCHIVES_URL:${{ inputs.nix_archives_url }} NIX_CONF:${{ inputs.nix_conf }} NIX_VERSION:${{ inputs.nix_version }} RELEASE_FILE:${{ github.action_path }}/RELEASE] map[] false 0}]} {gray-dark zap}} from '/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/action.yml' 
DEBU[0001] About to run action &{Nix Quick Install Rickard Nilsson Quickly installs Nix in unprivileged single-user mode map[nix_archives_url:{Don't use. For bootstrapping purposes only.
 false } nix_conf:{If set, this configuration is written to a new file which is then added to
the NIX_USER_CONF_FILES environment variable. You can also set that
variable yourself to control the Nix configuration.
 false } nix_version:{The version of Nix that should be installed

If not specified, the latest stable Nix release is used. Note that each
release of nix-quick-install-action has a specific set of supported
Nix versions, which do not change. You can check what Nix versions are
supported by the version of nix-quick-install-action you're using by
going to https://github.com/nixbuild/nix-quick-install-action/releases
 true 2.3.10}] map[] {composite map[]   [] [] [{ {0 0    <nil> []    0 0} Install Nix in single-user mode  ${{ github.action_path }}/nix-quick-install.sh  bash map[NIX_ARCHIVES_URL:${{ inputs.nix_archives_url }} NIX_CONF:${{ inputs.nix_conf }} NIX_VERSION:${{ inputs.nix_version }} RELEASE_FILE:${{ github.action_path }}/RELEASE] map[] false 0}]} {gray-dark zap}} 
DEBU[0001] type=3 actionDir=/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5 actionPath= Workdir=/Users/anka/projekt/gf-lsp ActionCacheDir=/Users/anka/.cache/act actionName=nixbuild-nix-quick-install-action@v5 containerActionDir=/var/run/act/actions/nixbuild-nix-quick-install-action@v5 
[example workflow/example]   🐳  docker cp src=/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ dst=/var/run/act/actions/nixbuild-nix-quick-install-action@v5/
[example workflow/example]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/nixbuild-nix-quick-install-action@v5/] user=
[example workflow/example] Exec command '[mkdir -p /var/run/act/actions/nixbuild-nix-quick-install-action@v5/]'
DEBU[0001] Writing tarball /tmp/act256865933 from /Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ 
DEBU[0001] Stripping prefix:/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ src:/Users/anka/.cache/act/nixbuild-nix-quick-install-action@v5/ 
[example workflow/example] Extracting content from '/tmp/act256865933' to '/var/run/act/actions/nixbuild-nix-quick-install-action@v5/'
DEBU[0001] Loading slug from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0001] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0001] Loading revision from git directory '/Users/anka/projekt/gf-lsp/.git' 
DEBU[0001] Found revision: 3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0001] HEAD points to '3583868e9aafc074c799726bc83bcac854187c85' 
DEBU[0001] Reference: name=refs/heads/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0001] Reference: name=refs/remotes/origin/main sha=3583868e9aafc074c799726bc83bcac854187c85 
DEBU[0001] Reference: name=HEAD sha=0000000000000000000000000000000000000000 
DEBU[0001] using github ref: refs/heads/main            
DEBU[0001] context env => map[ACT:true]                 
DEBU[0001] context env => map[ACT:true CI:true GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:example GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/main GITHUB_REPOSITORY:anka-213/gf-lsp GITHUB_REPOSITORY_OWNER:anka-213 GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:3583868e9aafc074c799726bc83bcac854187c85 GITHUB_TOKEN: GITHUB_WORKFLOW:example workflow GITHUB_WORKSPACE:/Users/anka/projekt/gf-lsp INPUT_NIX_ARCHIVES_URL: INPUT_NIX_CONF: INPUT_NIX_VERSION:2.3.10 ImageOS:ubuntu20 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID:] 
DEBU[0001] Wrote command '
/var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/nix-quick-install.sh
' to 'workflow/composite-0.sh' 
DEBU[0001] Writing entry to tarball workflow/composite-0.sh len:115 
[example workflow/example] Extracting content to '/Users/anka/projekt/gf-lsp'
[example workflow/example]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/anka/projekt/gf-lsp/workflow/composite-0.sh] user=
[example workflow/example] Exec command '[bash --noprofile --norc -e -o pipefail /Users/anka/projekt/gf-lsp/workflow/composite-0.sh]'
| /Users/anka/projekt/gf-lsp/workflow/composite-0.sh: line 1: /var/run/act/actions/nixbuild-nix-quick-install-action@v5/nixbuild-nix-quick-install-action@v5/nix-quick-install.sh: No such file or directory
[example workflow/example]   ❌  Failure - nixbuild/nix-quick-install-action@v5
DEBU[0002] exit with `FAILURE`: 127                     
Error: exit with `FAILURE`: 127
@anka-213 anka-213 added the kind/bug Something isn't working label May 27, 2021
ChristopherHX added a commit to ChristopherHX/act that referenced this issue May 28, 2021
Remove invalid workaround for local composite action
Resolves nektos#708
ChristopherHX added a commit to ChristopherHX/act that referenced this issue May 28, 2021
Remove invalid workaround for local composite action
Resolves nektos#708
ChristopherHX added a commit to ChristopherHX/act that referenced this issue May 29, 2021
Skips docker cp for local actions and use their correct path
Allow cloning local actions where you wish
Defines GITHUB_ACTION_PATH also for nodejs actions
Evaluate Env of composite action
Evaluate Run of composite action correctly
Evaluate Shell of composite action
Evaluate WorkingDirectory of composite action

Resolves nektos#664
Resolves nektos#707
Resolves nektos#708
Replaces nektos#709
ChristopherHX added a commit to ChristopherHX/act that referenced this issue May 29, 2021
Skips docker cp for local actions and use their correct path
Allow cloning local actions where you wish
Defines GITHUB_ACTION_PATH also for nodejs actions
Evaluate Env of composite action
Evaluate Run of composite action correctly
Evaluate Shell of run step
Evaluate WorkingDirectory of run step

Resolves nektos#640
Resolves nektos#664
Resolves nektos#707
Resolves nektos#708
Replaces nektos#709
@jsoref
Copy link
Contributor

jsoref commented Jun 4, 2021

Sorry about that. I thought I'd eventually fixed that. (Partially a hazard of testing an action where the org and repository have the same name.)

@mergify mergify bot closed this as completed in #712 Jun 10, 2021
@catthehacker catthehacker added the meta/resolved Issue has been fixed or valid solution has been provided (not workaround) label Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)
Projects
None yet
3 participants