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

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.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 21
  • Comments: 42 (18 by maintainers)

Most upvoted comments

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

@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.

I had the same problem but running the workflow in dry mode and passing github token it works I read it from here https://github.com/nektos/act/issues/779#issuecomment-932997696

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

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).

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

Thanks.

Update: On Mac, just do brew unlink act && brew install act --HEAD as per https://github.com/nektos/act/issues/678#issuecomment-850466260

~So, the way to get the snapshot to work on Mac appears to be:~

~1. Go to https://github.com/nektos/act/pull/680/checks?check_run_id=2535655295 and click on the “Artifacts” dropdown on the right.~ ~2. Click on act-macos to download the zip file containing the binary~ ~3. unzip act-macos.zip to create a file call act~ ~4. In a Terminal, navigate to where you unzipped act-macos.zip and add executable permissions to the act file typing: chmod a+x act~ ~5. Bypass MacOS gatekeeper by typing open act. This will open a Terminal window. Close it when it says “[Process completed]”.~ ~6. Move act to a directory on your path. e.g. mv act /usr/local/bin~

~When the next version of act is released, delete usr/local/bin/act and then install the new version.~

Hi there! Can there be a minor release for this?

Works great, thanks for your help!

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

@marnix you can also just download the prerelease artifact from the PR: https://github.com/nektos/act/suites/2686549445/artifacts/59224642

@Lexmark-peachj can you test this build and see if it fixes your use case? https://github.com/nektos/act/suites/2686549445/artifacts/59224642

Spotted and fixed as part of another, I’ll hot fix this real quick.

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

I’m on Ubuntu 20.04. I downloaded the Linux tar.gz for the previous release of v0.2.20 here. After unzipping and extracting the act executable from the tar.gz file, I’m able to execute the examples in the demo repo without the error described in this issue.

Fantastic. Thanks @TonalidadeHidrica!

This info is outdated. Actually there's a better way for `brew`.
  • Run brew edit act. It will open a file named act.rb, so add the following lines:
diff --git a/Formula/act.rb b/Formula/act.rb
index 71f23c75e2..150bb615e9 100644
--- a/Formula/act.rb
+++ b/Formula/act.rb
@@ -12,6 +12,10 @@ class Act < Formula
     sha256 cellar: :any_skip_relocation, mojave:        "907341331521809d5822597a8ec000d6b0fa5a0c400807b5b76fa546de6c5b91"
   end

+  head do
+    url "https://github.com/nektos/act.git"
+  end
+
   depends_on "go" => :build

   def install
  • Now brew unlink act and brew install --HEAD act. You’ve got a fixed latest version! Hooray!

@catthehacker, good call!

Is it possible to do this with Brew? I can use the snapshot build personally but will have a hard time propagating this across team workflows 😃