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: Checkout fails on 0.2.22 - "Input required and not supplied: token" #678

Closed
Lexmark-peachj opened this issue May 7, 2021 · 42 comments · Fixed by #680
Closed

Issue: Checkout fails on 0.2.22 - "Input required and not supplied: token" #678

Lexmark-peachj opened this issue May 7, 2021 · 42 comments · Fixed by #680
Assignees
Labels
area/runner Relating to errors in the runner kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)
Milestone

Comments

@Lexmark-peachj
Copy link

Act version

0.2.22

Expected behaviour

The checkout action's behavior is different between 0.2.21 and 0.22.22. In 0.2.21, checkout seemed to docker cp the repository into the image rather than perform an actual checkout. This was desirable because local changes to actions and associated scripts were properly consumed without having to push them to the repository.

Actual behaviour

act 0.2.22 actually checks out the repo. This has two immediate downsides:

  1. The repo now seems to require a token when it did not before.
  2. Even if I supply a token, I now don't have any other local changes I have to scripts that support my actions because the code was actually cloned instead of cp'd from my local workspace.

Workflow and/or repository

My checkout action was this:

  - name: Check out code
    uses: actions/checkout@v2

act output

Log
[create-terraform-resources/build] ⭐  Run Check out code
[create-terraform-resources/build]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2
[create-terraform-resources/build]   🐳  docker cp src=/root/.cache/act/actions-checkout@v2/ dst=/home/sre/sre/_actions/actions-checkout@v2/
[create-terraform-resources/build]   ❓  ::save-state name=isPost,::true
[create-terraform-resources/build]   💬  ::debug::GITHUB_WORKSPACE = '/home/sre/sre'
[create-terraform-resources/build]   💬  ::debug::qualified repository = 'LexmarkDevOps/SRE'
[create-terraform-resources/build]   💬  ::debug::ref = 'refs/heads/feature/create-terraform-resources-action'
[create-terraform-resources/build]   💬  ::debug::commit = '0d9d65062e5eacaea789c88c7e081cd5c963452a'
[create-terraform-resources/build]   💬  ::debug::clean = true
[create-terraform-resources/build]   💬  ::debug::fetch depth = 1
[create-terraform-resources/build]   💬  ::debug::lfs = false
[create-terraform-resources/build]   💬  ::debug::submodules = false
[create-terraform-resources/build]   💬  ::debug::recursive submodules = false
[create-terraform-resources/build]   ❗  ::error::Input required and not supplied: token
[create-terraform-resources/build]   ❌  Failure - Check out code

Note: I'm new to using act and GitHub Actions, so please let me know if I should do something differently in my workflow.

@Lexmark-peachj Lexmark-peachj added the kind/bug Something isn't working label May 7, 2021
@catthehacker catthehacker self-assigned this May 7, 2021
@catthehacker catthehacker added this to Needs triage in Bug squashing via automation May 7, 2021
@catthehacker catthehacker moved this from Needs triage to High priority in Bug squashing May 7, 2021
@catthehacker
Copy link
Member

Broken as of 0f04942

@catthehacker

This comment has been minimized.

@catthehacker catthehacker added the area/runner Relating to errors in the runner label May 7, 2021
@JustinGrote

This comment has been minimized.

@catthehacker

This comment has been minimized.

@JustinGrote

This comment has been minimized.

@JustinGrote

This comment has been minimized.

@mergify mergify bot closed this as completed in #680 May 10, 2021
Bug squashing automation moved this from High priority to Closed May 10, 2021
@Lexmark-peachj
Copy link
Author

Works great, thanks for your help!

@catthehacker catthehacker pinned this issue May 17, 2021
@cyc115

This comment has been minimized.

@catthehacker

This comment has been minimized.

@bixu

This comment has been minimized.

@catthehacker

This comment has been minimized.

@bixu

This comment has been minimized.

@catthehacker

This comment has been minimized.

@catthehacker catthehacker changed the title Issue: Checkout fails on 0.2.22 Issue: Checkout fails on 0.2.22 - "Input required and not supplied: token" May 20, 2021
@nathanagez

This comment has been minimized.

@akrabat

This comment has been minimized.

@catthehacker

This comment has been minimized.

@akrabat

This comment has been minimized.

@TonalidadeHidrica
Copy link

TonalidadeHidrica commented May 28, 2021

I updated the Homebrew formula, so now the HEAD version is available via brew install act --HEAD (after brew update and maybe brew unlink act).

@catthehacker

This comment has been minimized.

@akrabat

This comment has been minimized.

@notmatthancock

This comment has been minimized.

@saniales

This comment has been minimized.

@TonalidadeHidrica

This comment has been minimized.

@catthehacker

This comment has been minimized.

@saniales

This comment has been minimized.

@marnix

This comment has been minimized.

@JustinGrote

This comment has been minimized.

@righel
Copy link

righel commented Jun 9, 2021

If I add the "with:" property I have the same token error, if I remove it works ok (using the latest version).
sample:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 
        uses: actions/checkout@v2
        with:
          ref: 'custom-branch'

output:

[CI/test]   ❗  ::error::Input required and not supplied: token
[CI/test]   ❌  Failure - Checkout
Error: exit with `FAILURE`: 1

@catthehacker
Copy link
Member

@righel because then you want to checkout specific version instead of what you have in your workdir so you need token

@catthehacker
Copy link
Member

v0.2.23 has been released that includes fix for this issue.

@catthehacker catthehacker unpinned this issue Jun 11, 2021
@lucasdemarchi
Copy link

Just tested master branch with https://github.com/git-pile/playground/tree/f2e5a12a837896ce9087d6d087b693009f2f0e48 and it seems broken for me:

[main/test-pile-application] 🚀  Start image=catthehacker/ubuntu:act-20.04
[main/test-pile-application]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[main/test-pile-application]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[main/test-pile-application] ⭐  Run Setup git
[main/test-pile-application]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/lucas/p/git-pile-playground/patches/workflow/0] user=
[main/test-pile-application]   ✅  Success - Setup git
[main/test-pile-application] ⭐  Run Fetch git-pile
INFO[0002]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2 
[main/test-pile-application]   🐳  docker cp src=/home/lucas/.cache/act/actions-checkout@v2/ dst=/var/run/act/actions/actions-checkout@v2/
[main/test-pile-application]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-checkout@v2/] user=
[main/test-pile-application]   🐳  docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user=
[main/test-pile-application]   ❓  ::save-state name=isPost,::true
[main/test-pile-application]   💬  ::debug::GITHUB_WORKSPACE = '/home/lucas/p/git-pile-playground/patches'
[main/test-pile-application]   💬  ::debug::qualified repository = 'git-pile/git-pile'
[main/test-pile-application]   💬  ::debug::ref = 'tip'
[main/test-pile-application]   💬  ::debug::commit = 'undefined'
[main/test-pile-application]   💬  ::debug::clean = true
[main/test-pile-application]   💬  ::debug::fetch depth = 1
[main/test-pile-application]   💬  ::debug::lfs = false
[main/test-pile-application]   💬  ::debug::submodules = false
[main/test-pile-application]   💬  ::debug::recursive submodules = false
[main/test-pile-application]   ❗  ::error::Input required and not supplied: token
[main/test-pile-application]   ❌  Failure - Fetch git-pile
Error: exit with `FAILURE`: 1

Note that in that workflow it's trying to checkout a specific branch of another (public) repository

@Siddharth-Ashri
Copy link

Siddharth-Ashri commented Jul 2, 2021

Trying it locally gives it the same error as above repo is private though

Just tested master branch with https://github.com/git-pile/playground/tree/f2e5a12a837896ce9087d6d087b693009f2f0e48 and it seems broken for me:

[main/test-pile-application] 🚀  Start image=catthehacker/ubuntu:act-20.04
[main/test-pile-application]   🐳  docker run image=catthehacker/ubuntu:act-20.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[main/test-pile-application]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root
[main/test-pile-application] ⭐  Run Setup git
[main/test-pile-application]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/lucas/p/git-pile-playground/patches/workflow/0] user=
[main/test-pile-application]   ✅  Success - Setup git
[main/test-pile-application] ⭐  Run Fetch git-pile
INFO[0002]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2 
[main/test-pile-application]   🐳  docker cp src=/home/lucas/.cache/act/actions-checkout@v2/ dst=/var/run/act/actions/actions-checkout@v2/
[main/test-pile-application]   🐳  docker exec cmd=[mkdir -p /var/run/act/actions/actions-checkout@v2/] user=
[main/test-pile-application]   🐳  docker exec cmd=[node /var/run/act/actions/actions-checkout@v2/dist/index.js] user=
[main/test-pile-application]   ❓  ::save-state name=isPost,::true
[main/test-pile-application]   💬  ::debug::GITHUB_WORKSPACE = '/home/lucas/p/git-pile-playground/patches'
[main/test-pile-application]   💬  ::debug::qualified repository = 'git-pile/git-pile'
[main/test-pile-application]   💬  ::debug::ref = 'tip'
[main/test-pile-application]   💬  ::debug::commit = 'undefined'
[main/test-pile-application]   💬  ::debug::clean = true
[main/test-pile-application]   💬  ::debug::fetch depth = 1
[main/test-pile-application]   💬  ::debug::lfs = false
[main/test-pile-application]   💬  ::debug::submodules = false
[main/test-pile-application]   💬  ::debug::recursive submodules = false
[main/test-pile-application]   ❗  ::error::Input required and not supplied: token
[main/test-pile-application]   ❌  Failure - Fetch git-pile
Error: exit with `FAILURE`: 1

Note that in that workflow it's trying to checkout a specific branch of another (public) repository

@lucasdemarchi
Copy link

@Siddharth-Ashri repo I'm referencing is not private

@catthehacker catthehacker added the meta/resolved Issue has been fixed or valid solution has been provided (not workaround) label Aug 17, 2021
@catthehacker catthehacker added this to the Other issues milestone Aug 17, 2021
@FrancescoSaverioZuppichini

same error here

@catthehacker
Copy link
Member

@Siddharth-Ashri repo I'm referencing is not private

if you checkout specific branch/commit/etc. token is required no matter if it's private or not

same error here

works for everyone else

@francisco-gs-colpal
Copy link

I had the same problem but running the workflow in dry mode and passing github token it works
I read it from here #779 (comment)

act -n -W my-workflow.yml -s GITHUB_TOKEN=$GITHUB_TOKEN

@epignatelli
Copy link

Dryrun only checks for correctness (#268 (comment)), it does not run the workflow.

@epignatelli
Copy link

@Siddharth-Ashri repo I'm referencing is not private

if you checkout specific branch/commit/etc. token is required no matter if it's private or not

same error here

works for everyone else

How is this solved?

  1. Still throws the same error, i.e. does not work for everyone else
  2. Without check a specific branch or commit.

This issue should be re-opened.

@till
Copy link
Contributor

till commented Nov 20, 2022

@epignatelli did you manage to resolve this, or do you still have that problem?

I have this in my steps:

      - name: clone example
        uses: actions/checkout@v3
        with:
          repository: public/repository

Yields:

[e2e/deploy_app] ⭐ Run Main clone example
[e2e/deploy_app]   🐳  docker cp src=/Users/till/.cache/act/actions-checkout@v3/ dst=/var/run/act/actions/actions-checkout@v3/
[e2e/deploy_app]   🐳  docker exec cmd=[node /var/run/act/actions/actions-checkout@v3/dist/index.js] user= workdir=
[e2e/deploy_app]   💬  ::debug::GITHUB_WORKSPACE = '/Users/till/Documents/workspaces/local/path'
[e2e/deploy_app]   💬  ::debug::qualified repository = 'public/repository'
[e2e/deploy_app]   💬  ::debug::ref = ''
[e2e/deploy_app]   💬  ::debug::commit = 'undefined'
[e2e/deploy_app]   💬  ::debug::clean = true
[e2e/deploy_app]   💬  ::debug::fetch depth = 1
[e2e/deploy_app]   💬  ::debug::lfs = false
[e2e/deploy_app]   💬  ::debug::submodules = false
[e2e/deploy_app]   💬  ::debug::recursive submodules = false
[e2e/deploy_app]   ❗  ::error::Input required and not supplied: token
[e2e/deploy_app]   ❌  Failure - Main clone example
[e2e/deploy_app] exitcode '1': failure

Maybe it changed with v3 to require this always? I guess for completeness, I am cloning inside a workflow run of a private repository. The initial clone works, but this one doesn't. Also tried setting an empty token to no avail.

@zhongweiy
Copy link

I'm on version act version 0.2.34 and using actions/checkout@v2 on a public repo. The error still exists.

The workaround is replacing uses: actions/checkout@v2 with a pure git clone run: git clone https://github.com/example/example.git, like this commit. It is inconvenient if you need to do other things by checkout@v2, you have to do it manually by shell commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runner Relating to errors in the runner kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)
Projects
Bug squashing
  
Closed
Development

Successfully merging a pull request may close this issue.