[GH-ISSUE #1343] Unable to clonem Error: authentication required on repository actions #721

Closed
opened 2026-03-01 21:45:49 +03:00 by kerem · 13 comments
Owner

Originally created by @Alegrowin on GitHub (Sep 12, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1343

Bug report info

act version:            0.2.31
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/vscode/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.5
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.31 -X main.commit=a20b1d4669d8d032fe35347bd3cfdae58b4d1d97 -X main.date=2022-09-01T02:56:14Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         a20b1d4669d8d032fe35347bd3cfdae58b4d1d97
                vcs.time:             2022-08-31T18:41:56Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.18
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Pop!_OS 22.04 LTS
        OS type:               linux
        OS version:            22.04
        OS arch:               x86_64
        OS kernel:             5.19.0-76051900-generic
        OS CPU:                16
        OS memory:             31805 MB
        Security options:
                name=apparmor
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act pull_request
act pull_request -s GITHUB_TOKEN

Describe issue

I just updated my local act version with the latest version.

When I run the act cli with a clean state, I keep getting authentication required.

act -s GITHUB_TOKEN pull_request -j lint
[MegaLinter/MegaLinter] 🚀  Start image=catthehacker/ubuntu:act-latest
[MegaLinter/MegaLinter]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[MegaLinter/MegaLinter]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[MegaLinter/MegaLinter]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[MegaLinter/MegaLinter]   ☁  git clone 'https://github.com/oxsecurity/megalinter' # ref=v6
[MegaLinter/MegaLinter] 🏁  Job succeeded
Error: authentication required

I tried all the version until v0.2.21 and it started to work again.
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -s v0.2.21

P.S. I'm running act inside a container inside vscode devcontainer with a mounted docker.sock on my host.

No response

Workflow content

---
# MegaLinter GitHub Action configuration file
# More info at https://oxsecurity.github.io/megalinter
name: MegaLinter

on:
  # Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
  push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
  pull_request:
    branches: [master, main]

env: # Comment env block if you do not want to apply fixes
  # Apply linter fixes configuration
  APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
  APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
  APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)

concurrency:
  group: ${{ github.ref }}-${{ github.workflow }}
  cancel-in-progress: true

jobs:
  build:
    name: MegaLinter
    runs-on: ubuntu-latest
    steps:
      # Git Checkout
      - name: Checkout Code
        uses: actions/checkout@v3
        with:
          token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
          fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances

      # MegaLinter
      - name: MegaLinter
        id: ml
        # You can override MegaLinter flavor used to have faster performances
        # More info at https://oxsecurity.github.io/megalinter/flavors/
        uses: oxsecurity/megalinter@v6
        env:
          # All available variables are described in documentation
          # https://oxsecurity.github.io/megalinter/configuration/
          VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
          # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks

      # Upload MegaLinter artifacts
      - name: Archive production artifacts
        if: ${{ success() }} || ${{ failure() }}
        uses: actions/upload-artifact@v2
        with:
          name: MegaLinter reports
          path: |
            megalinter-reports
            mega-linter.log

      # Create pull request if applicable (for now works only on PR from same repository, not from forks)
      - name: Create Pull Request with applied fixes
        id: cpr
        if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
        uses: peter-evans/create-pull-request@v4
        with:
          token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
          commit-message: "[MegaLinter] Apply linters automatic fixes"
          title: "[MegaLinter] Apply linters automatic fixes"
          labels: bot
      - name: Create PR output
        if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
        run: |
          echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
          echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"

      # Push new commit if applicable (for now works only on PR from same repository, not from forks)
      - name: Prepare commit
        if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
        run: sudo chown -Rc $UID .git/
      - name: Commit and push applied linter fixes
        if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          commit_message: "[MegaLinter] Apply linters fixes"

Relevant log output

[MegaLinter/MegaLinter ] Unable to clone https://github.com/oxsecurity/megalinter refs/heads/v6: authentication required
[MegaLinter/MegaLinter ] 🏁  Job succeeded
[Pulumi-Preview/Preview] Unable to clone https://github.com/actions/setup-python refs/heads/v2: authentication required
[Pulumi-Preview/Preview] 🏁  Job succeeded
Error: authentication required

Additional information

No response

Originally created by @Alegrowin on GitHub (Sep 12, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1343 ### Bug report info ```plain text act version: 0.2.31 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/vscode/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.5 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.31 -X main.commit=a20b1d4669d8d032fe35347bd3cfdae58b4d1d97 -X main.date=2022-09-01T02:56:14Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: a20b1d4669d8d032fe35347bd3cfdae58b4d1d97 vcs.time: 2022-08-31T18:41:56Z vcs.modified: false Docker Engine: Engine version: 20.10.18 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Pop!_OS 22.04 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.19.0-76051900-generic OS CPU: 16 OS memory: 31805 MB Security options: name=apparmor name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act pull_request act pull_request -s GITHUB_TOKEN ``` ### Describe issue I just updated my local act version with the latest version. When I run the act cli with a clean state, I keep getting authentication required. ``` act -s GITHUB_TOKEN pull_request -j lint [MegaLinter/MegaLinter] 🚀 Start image=catthehacker/ubuntu:act-latest [MegaLinter/MegaLinter] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false [MegaLinter/MegaLinter] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [MegaLinter/MegaLinter] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [MegaLinter/MegaLinter] ☁ git clone 'https://github.com/oxsecurity/megalinter' # ref=v6 [MegaLinter/MegaLinter] 🏁 Job succeeded Error: authentication required ``` I tried all the version until v0.2.21 and it started to work again. curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -s v0.2.21 P.S. I'm running act inside a container inside vscode devcontainer with a mounted docker.sock on my host. ### Link to GitHub repository _No response_ ### Workflow content ```yml --- # MegaLinter GitHub Action configuration file # More info at https://oxsecurity.github.io/megalinter name: MegaLinter on: # Trigger mega-linter at every push. Action will also be visible from Pull Requests to main push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) pull_request: branches: [master, main] env: # Comment env block if you do not want to apply fixes # Apply linter fixes configuration APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: build: name: MegaLinter runs-on: ubuntu-latest steps: # Git Checkout - name: Checkout Code uses: actions/checkout@v3 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances # MegaLinter - name: MegaLinter id: ml # You can override MegaLinter flavor used to have faster performances # More info at https://oxsecurity.github.io/megalinter/flavors/ uses: oxsecurity/megalinter@v6 env: # All available variables are described in documentation # https://oxsecurity.github.io/megalinter/configuration/ VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks # Upload MegaLinter artifacts - name: Archive production artifacts if: ${{ success() }} || ${{ failure() }} uses: actions/upload-artifact@v2 with: name: MegaLinter reports path: | megalinter-reports mega-linter.log # Create pull request if applicable (for now works only on PR from same repository, not from forks) - name: Create Pull Request with applied fixes id: cpr if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} commit-message: "[MegaLinter] Apply linters automatic fixes" title: "[MegaLinter] Apply linters automatic fixes" labels: bot - name: Create PR output if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) run: | echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" # Push new commit if applicable (for now works only on PR from same repository, not from forks) - name: Prepare commit if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) run: sudo chown -Rc $UID .git/ - name: Commit and push applied linter fixes if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) uses: stefanzweifel/git-auto-commit-action@v4 with: branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} commit_message: "[MegaLinter] Apply linters fixes" ``` ### Relevant log output ```sh [MegaLinter/MegaLinter ] Unable to clone https://github.com/oxsecurity/megalinter refs/heads/v6: authentication required [MegaLinter/MegaLinter ] 🏁 Job succeeded [Pulumi-Preview/Preview] Unable to clone https://github.com/actions/setup-python refs/heads/v2: authentication required [Pulumi-Preview/Preview] 🏁 Job succeeded Error: authentication required ``` ### Additional information _No response_
kerem 2026-03-01 21:45:49 +03:00
Author
Owner

@emptyflask commented on GitHub (Sep 21, 2022):

Same here, using act v0.2.31 and a known good github token (which is also present in the current env, but figured I'd explicitly pass it into act as well):

act -v -j Test -s GITHUB_TOKEN=$(pass api.github.com | head -1) -W ./.github/workflows/rubyonrails.yml --env-file .env.test
...
Ruby on Rails CI/Test]   ☁  git clone 'https://github.com/ruby/setup-ruby' # ref=v1
[Ruby on Rails CI/Test] [DEBUG]   cloning https://github.com/ruby/setup-ruby to /home/jon/.cache/act/ruby-setup-ruby@v1
[Ruby on Rails CI/Test] Unable to clone https://github.com/ruby/setup-ruby refs/heads/v1: authentication required
[Ruby on Rails CI/Test] [DEBUG] skipping post step for 'Install Ruby and gems'; step was not executed
[Ruby on Rails CI/Test] [DEBUG] skipping post step for 'Checkout code'; step was not executed
<!-- gh-comment-id:1254271335 --> @emptyflask commented on GitHub (Sep 21, 2022): Same here, using act v0.2.31 and a known good github token (which is also present in the current env, but figured I'd explicitly pass it into act as well): ``` act -v -j Test -s GITHUB_TOKEN=$(pass api.github.com | head -1) -W ./.github/workflows/rubyonrails.yml --env-file .env.test ... Ruby on Rails CI/Test] ☁ git clone 'https://github.com/ruby/setup-ruby' # ref=v1 [Ruby on Rails CI/Test] [DEBUG] cloning https://github.com/ruby/setup-ruby to /home/jon/.cache/act/ruby-setup-ruby@v1 [Ruby on Rails CI/Test] Unable to clone https://github.com/ruby/setup-ruby refs/heads/v1: authentication required [Ruby on Rails CI/Test] [DEBUG] skipping post step for 'Install Ruby and gems'; step was not executed [Ruby on Rails CI/Test] [DEBUG] skipping post step for 'Checkout code'; step was not executed ```
Author
Owner

@ValeHaas commented on GitHub (Oct 14, 2022):

I just ran into this issue as well (on Windows) and I could solve it by logging out of Docker Desktop, as hinted on by https://github.com/nektos/act/issues/1166#issuecomment-1133637204

<!-- gh-comment-id:1278743090 --> @ValeHaas commented on GitHub (Oct 14, 2022): I just ran into this issue as well (on Windows) and I could solve it by logging out of Docker Desktop, as hinted on by https://github.com/nektos/act/issues/1166#issuecomment-1133637204
Author
Owner

@github-actions[bot] commented on GitHub (Nov 14, 2022):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1312866421 --> @github-actions[bot] commented on GitHub (Nov 14, 2022): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@elvinristi commented on GitHub (Dec 22, 2022):

I got this same error when I had incorrect GITHUB_TOKEN value.
Generating new one which started with ghp_ and assigning this fixed Error: authentication required

<!-- gh-comment-id:1362670389 --> @elvinristi commented on GitHub (Dec 22, 2022): I got this same error when I had incorrect `GITHUB_TOKEN` value. Generating new one which started with `ghp_` and assigning this fixed `Error: authentication required`
Author
Owner

@melMass commented on GitHub (Jul 22, 2023):

I know it's an old issue, but it has high hits on google.
I had this issue when using the scoop install with act -s GITHUB_TOKEN="$(gh auth token)" but just uninstalled the scoop package and used the gh extension gh extension install https://github.com/nektos/gh-act, auth is done properly without explicitly passing the token now

<!-- gh-comment-id:1646578864 --> @melMass commented on GitHub (Jul 22, 2023): I know it's an old issue, but it has high hits on google. I had this issue when using the scoop install with `act -s GITHUB_TOKEN="$(gh auth token)"` but just uninstalled the scoop package and used the gh extension `gh extension install https://github.com/nektos/gh-act`, auth is done properly without explicitly passing the token now
Author
Owner

@V0lantis commented on GitHub (Nov 16, 2023):

Didn't work for me 😢

gh act \
  --github-instance "github.mpi-internal.com" \
  -s GITHUB_TOKEN="$(gh auth token)"

resulted in

[build/publish_image]   ☁  git clone 'https://github.xxx.com/actions/setup-python' # ref=v4
[build/publish_image] Cleaning up container for job publish_image
[build/publish_image] 🏁  Job succeeded
Error: authentication required
<!-- gh-comment-id:1814502355 --> @V0lantis commented on GitHub (Nov 16, 2023): Didn't work for me 😢 ``` gh act \ --github-instance "github.mpi-internal.com" \ -s GITHUB_TOKEN="$(gh auth token)" ``` resulted in ``` [build/publish_image] ☁ git clone 'https://github.xxx.com/actions/setup-python' # ref=v4 [build/publish_image] Cleaning up container for job publish_image [build/publish_image] 🏁 Job succeeded Error: authentication required ```
Author
Owner

@soubhik-c commented on GitHub (Jan 5, 2024):

I'm getting the same error with v0.2.31 and new ghp_ GITHUB_TOKEN

<!-- gh-comment-id:1878179765 --> @soubhik-c commented on GitHub (Jan 5, 2024): I'm getting the same error with v0.2.31 and new ghp_ GITHUB_TOKEN
Author
Owner

@bonzofenix commented on GitHub (Jan 22, 2024):

Same error here !

<!-- gh-comment-id:1904008430 --> @bonzofenix commented on GitHub (Jan 22, 2024): Same error here !
Author
Owner

@smagret commented on GitHub (Apr 9, 2024):

Same here with v0.2.60:
gh act -j install_in_docker -s GITHUB_TOKEN="$(gh auth token)"

name: TEST!!

on:
  workflow_dispatch

jobs:
  install_in_docker:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4'

Resulted in

[TEST!!/install_in_docker] 🚀  Start image=catthehacker/ubuntu:act-latest
time="2024-04-09T15:25:43+02:00" level=info msg="Parallel tasks (0) below minimum, setting to 1"
[TEST!!/install_in_docker]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
time="2024-04-09T15:25:44+02:00" level=info msg="Parallel tasks (0) below minimum, setting to 1"
[TEST!!/install_in_docker]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[TEST!!/install_in_docker]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[TEST!!/install_in_docker]   ☁  git clone 'https://github.com/shivammathur/setup-php' # ref=v2
[TEST!!/install_in_docker] Unable to clone https://github.com/shivammathur/setup-php refs/heads/v2: authentication required
[TEST!!/install_in_docker] Cleaning up container for job install_in_docker
[TEST!!/install_in_docker] 🏁  Job succeeded
Error: authentication required

Solved

Okay!! While writing this I found that the problem is the -s GITHUB_TOKEN="$(gh auth token)", I ran the same command without setting the token and worked (gh act -j install_in_docker)

<!-- gh-comment-id:2045194349 --> @smagret commented on GitHub (Apr 9, 2024): Same here with v0.2.60: `gh act -j install_in_docker -s GITHUB_TOKEN="$(gh auth token)"` ```yaml name: TEST!! on: workflow_dispatch jobs: install_in_docker: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '7.4' ``` Resulted in ``` [TEST!!/install_in_docker] 🚀 Start image=catthehacker/ubuntu:act-latest time="2024-04-09T15:25:43+02:00" level=info msg="Parallel tasks (0) below minimum, setting to 1" [TEST!!/install_in_docker] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true time="2024-04-09T15:25:44+02:00" level=info msg="Parallel tasks (0) below minimum, setting to 1" [TEST!!/install_in_docker] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [TEST!!/install_in_docker] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [TEST!!/install_in_docker] ☁ git clone 'https://github.com/shivammathur/setup-php' # ref=v2 [TEST!!/install_in_docker] Unable to clone https://github.com/shivammathur/setup-php refs/heads/v2: authentication required [TEST!!/install_in_docker] Cleaning up container for job install_in_docker [TEST!!/install_in_docker] 🏁 Job succeeded Error: authentication required ``` --- ### Solved Okay!! While writing this I found that the problem is the `-s GITHUB_TOKEN="$(gh auth token)"`, I ran the same command without setting the token and worked (`gh act -j install_in_docker`)
Author
Owner

@jgf5013 commented on GitHub (Apr 17, 2024):

Okay!! While writing this I found that the problem is the -s GITHUB_TOKEN="$(gh auth token)", I ran the same command without setting the token and worked (gh act -j install_in_docker)

Well that's weird... I ran into the same issue and reran my command without the -s flag and now back to working

<!-- gh-comment-id:2061945734 --> @jgf5013 commented on GitHub (Apr 17, 2024): > Okay!! While writing this I found that the problem is the `-s GITHUB_TOKEN="$(gh auth token)"`, I ran the same command without setting the token and worked (`gh act -j install_in_docker`) Well that's weird... I ran into the same issue and reran my command without the `-s` flag and now back to working
Author
Owner

@mrclrchtr commented on GitHub (Aug 19, 2024):

I can't get it work... neither with gh act nor with act and -s GITHUB_TOKEN="$(gh auth token)".

it's only working, when I put the token manually with -s GITHUB_TOKEN=mytoken .

<!-- gh-comment-id:2297361856 --> @mrclrchtr commented on GitHub (Aug 19, 2024): I can't get it work... neither with `gh act` nor with `act` and `-s GITHUB_TOKEN="$(gh auth token)"`. it's only working, when I put the token manually with `-s GITHUB_TOKEN=mytoken `.
Author
Owner

@Kixunil commented on GitHub (Sep 10, 2024):

Why would it even need the token? The repository is public anyway. I had a type and wrote action/checkout instead of actions/checkout.

<!-- gh-comment-id:2340044342 --> @Kixunil commented on GitHub (Sep 10, 2024): ~~Why would it even need the token? The repository is public anyway.~~ I had a type and wrote `action/checkout` instead of `actions/checkout`.
Author
Owner

@nam20485 commented on GitHub (May 21, 2025):

I know it's an old issue, but it has high hits on google. I had this issue when using the scoop install with act -s GITHUB_TOKEN="$(gh auth token)" but just uninstalled the scoop package and used the gh extension gh extension install https://github.com/nektos/gh-act, auth is done properly without explicitly passing the token now

This worked me. Just:

gh auth login
gh extension install https://github.com/nektos/gh-act

Just works now- I dont't have pass any args or put GITHUB_TOKEN in the environment.

<!-- gh-comment-id:2899363416 --> @nam20485 commented on GitHub (May 21, 2025): > I know it's an old issue, but it has high hits on google. I had this issue when using the scoop install with `act -s GITHUB_TOKEN="$(gh auth token)"` but just uninstalled the scoop package and used the gh extension `gh extension install https://github.com/nektos/gh-act`, auth is done properly without explicitly passing the token now This worked me. Just: ```Pwsh gh auth login gh extension install https://github.com/nektos/gh-act ``` _Just works now- I dont't have pass any args or put GITHUB_TOKEN in the environment._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#721
No description provided.