[GH-ISSUE #1228] Unable run act on scripts that are using php-actions/php-build #676

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

Originally created by @abagayev on GitHub (Jun 23, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1228

Bug report info

act version:            0.2.28
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/anton.bagaiev/.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
        .actrc:
                --env-file .env.act
                --container-architecture linux/amd64
Build info:
        Go version:            go1.18.3
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.28
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
Docker Engine:
        Engine version:        20.10.16
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             5.10.104-linuxkit
        OS CPU:                5
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act workflow_dispatch --env-file .env.act --container-architecture linux/amd64

Describe issue

Looks like php-actions/php-build which is used by php-actions/composer is not getting ACTION_TOKEN variable which causes to the failure.

No response

Workflow content

name: Build and push

on:
    workflow_dispatch:

jobs:
    build:
        name: Build and push
        runs-on: ubuntu-latest
        steps:
            -   name: Checkout
                uses: actions/checkout@v2

            -   name: Cache dependencies
                uses: actions/cache@v2
                with:
                    path: /tmp/composer-cache
                    key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

            -   name: Install dependencies
                uses: php-actions/composer@v6
                with:
                    php_version: 7.4
                    php_extensions: zip pcntl sockets bcmath gd intl
                    version: 1

# ...

Relevant log output

[Build and push Nginx/Build and push] 🚀  Start image=ghcr.io/catthehacker/ubuntu:act-latest
[Build and push Nginx/Build and push]   🐳  docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=false
[Build and push Nginx/Build and push]   🐳  docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build and push Nginx/Build and push]   🐳  docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Build and push Nginx/Build and push]   🐳  docker exec cmd=[chown -R 0:0 /Users/anton.bagaiev/Development/backoffice_vanmoof_com] user=0 workdir=
[Build and push Nginx/Build and push]   ☁  git clone 'https://github.com/php-actions/composer' # ref=v6
[Build and push Nginx/Build and push] ⭐ Run Pre Install dependencies
[Build and push Nginx/Build and push]   ✅  Success - Pre Install dependencies
[Build and push Nginx/Build and push]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v3
[Build and push Nginx/Build and push] ⭐ Run Main Checkout
[Build and push Nginx/Build and push]   🐳  docker cp src=/Users/anton.bagaiev/Development/backoffice_vanmoof_com/. dst=/Users/anton.bagaiev/Development/backoffice_vanmoof_com
[Build and push Nginx/Build and push] close /var/folders/pb/kx4zw05x4qj3vbdyfpk59tbm0000gp/T/act571066961: file already closed
[Build and push Nginx/Build and push]   🐳  docker exec cmd=[chown -R 0:0 /Users/anton.bagaiev/Development/backoffice_vanmoof_com] user=0 workdir=
[Build and push Nginx/Build and push]   ✅  Success - Main Checkout
[Build and push Nginx/Build and push] ⭐ Run Main Install dependencies
[Build and push Nginx/Build and push]   🐳  docker cp src=/Users/anton.bagaiev/.cache/act/php-actions-composer@v6/ dst=/var/run/act/actions/php-actions-composer@v6/
[Build and push Nginx/Build and push] close /var/folders/pb/kx4zw05x4qj3vbdyfpk59tbm0000gp/T/act3624355777: file already closed
[Build and push Nginx/Build and push]   🐳  docker exec cmd=[chown -R 0:0 /var/run/act/actions/php-actions-composer@v6/] user=0 workdir=
[Build and push Nginx/Build and push] ⭐ Run Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; }
[Build and push Nginx/Build and push]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/composer_run.sh] user= workdir=
| Error: ACTION_TOKEN variable not set
[Build and push Nginx/Build and push]   ❓  ::group::Debug output
| Running php-build composer
| Running php-build composer
[Build and push Nginx/Build and push]   ❓  ::endgroup::
[Build and push Nginx/Build and push]   ❌  Failure - Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; }
[Build and push Nginx/Build and push] exitcode '1': failure
[Build and push Nginx/Build and push]   ⚙  ::set-output:: full_command=
[Build and push Nginx/Build and push]   ❌  Failure - Main Install dependencies
[Build and push Nginx/Build and push] exitcode '1': failure
...

Additional information

No response

Originally created by @abagayev on GitHub (Jun 23, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1228 ### Bug report info ```plain text act version: 0.2.28 GOOS: darwin GOARCH: arm64 NumCPU: 10 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/anton.bagaiev/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 .actrc: --env-file .env.act --container-architecture linux/amd64 Build info: Go version: go1.18.3 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.28 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin Docker Engine: Engine version: 20.10.16 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 5.10.104-linuxkit OS CPU: 5 OS memory: 7851 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act workflow_dispatch --env-file .env.act --container-architecture linux/amd64 ``` ### Describe issue Looks like `php-actions/php-build` which is used by `php-actions/composer` is not getting `ACTION_TOKEN` variable which causes to the failure. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Build and push on: workflow_dispatch: jobs: build: name: Build and push runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Cache dependencies uses: actions/cache@v2 with: path: /tmp/composer-cache key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - name: Install dependencies uses: php-actions/composer@v6 with: php_version: 7.4 php_extensions: zip pcntl sockets bcmath gd intl version: 1 # ... ``` ### Relevant log output ```sh [Build and push Nginx/Build and push] 🚀 Start image=ghcr.io/catthehacker/ubuntu:act-latest [Build and push Nginx/Build and push] 🐳 docker pull image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=false [Build and push Nginx/Build and push] 🐳 docker create image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build and push Nginx/Build and push] 🐳 docker run image=ghcr.io/catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Build and push Nginx/Build and push] 🐳 docker exec cmd=[chown -R 0:0 /Users/anton.bagaiev/Development/backoffice_vanmoof_com] user=0 workdir= [Build and push Nginx/Build and push] ☁ git clone 'https://github.com/php-actions/composer' # ref=v6 [Build and push Nginx/Build and push] ⭐ Run Pre Install dependencies [Build and push Nginx/Build and push] ✅ Success - Pre Install dependencies [Build and push Nginx/Build and push] ☁ git clone 'https://github.com/actions/setup-node' # ref=v3 [Build and push Nginx/Build and push] ⭐ Run Main Checkout [Build and push Nginx/Build and push] 🐳 docker cp src=/Users/anton.bagaiev/Development/backoffice_vanmoof_com/. dst=/Users/anton.bagaiev/Development/backoffice_vanmoof_com [Build and push Nginx/Build and push] close /var/folders/pb/kx4zw05x4qj3vbdyfpk59tbm0000gp/T/act571066961: file already closed [Build and push Nginx/Build and push] 🐳 docker exec cmd=[chown -R 0:0 /Users/anton.bagaiev/Development/backoffice_vanmoof_com] user=0 workdir= [Build and push Nginx/Build and push] ✅ Success - Main Checkout [Build and push Nginx/Build and push] ⭐ Run Main Install dependencies [Build and push Nginx/Build and push] 🐳 docker cp src=/Users/anton.bagaiev/.cache/act/php-actions-composer@v6/ dst=/var/run/act/actions/php-actions-composer@v6/ [Build and push Nginx/Build and push] close /var/folders/pb/kx4zw05x4qj3vbdyfpk59tbm0000gp/T/act3624355777: file already closed [Build and push Nginx/Build and push] 🐳 docker exec cmd=[chown -R 0:0 /var/run/act/actions/php-actions-composer@v6/] user=0 workdir= [Build and push Nginx/Build and push] ⭐ Run Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; } [Build and push Nginx/Build and push] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/composer_run.sh] user= workdir= | Error: ACTION_TOKEN variable not set [Build and push Nginx/Build and push] ❓ ::group::Debug output | Running php-build composer | Running php-build composer [Build and push Nginx/Build and push] ❓ ::endgroup:: [Build and push Nginx/Build and push] ❌ Failure - Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; } [Build and push Nginx/Build and push] exitcode '1': failure [Build and push Nginx/Build and push] ⚙ ::set-output:: full_command= [Build and push Nginx/Build and push] ❌ Failure - Main Install dependencies [Build and push Nginx/Build and push] exitcode '1': failure ... ``` ### Additional information _No response_
kerem 2026-03-01 21:45:27 +03:00
Author
Owner

@catthehacker commented on GitHub (Jun 23, 2022):

You didn't pass GITHUB_TOKEN with act

github.com/php-actions/composer@9c88ad8df7/action.yml (L84)

<!-- gh-comment-id:1164301147 --> @catthehacker commented on GitHub (Jun 23, 2022): You didn't pass `GITHUB_TOKEN` with act https://github.com/php-actions/composer/blob/9c88ad8df70bd9faefaca6572694f359fcb03963/action.yml#L84
Author
Owner

@abagayev commented on GitHub (Jun 23, 2022):

I have it in my .env.act file, do I need to define it somewhere else?

<!-- gh-comment-id:1164321769 --> @abagayev commented on GitHub (Jun 23, 2022): I have it in my `.env.act` file, do I need to define it somewhere else?
Author
Owner

@ChristopherHX commented on GitHub (Jun 23, 2022):

GITHUB_TOKEN is expected to provided by a secret file --secret-file ( not --env-file ), the default is a file called .secrets.
secrets and environment variables are two different concepts in github actions.

<!-- gh-comment-id:1164406964 --> @ChristopherHX commented on GitHub (Jun 23, 2022): `GITHUB_TOKEN` is expected to provided by a secret file `--secret-file` ( not `--env-file` ), the default is a file called `.secrets`. secrets and environment variables are two different concepts in github actions.
Author
Owner

@abagayev commented on GitHub (Jun 24, 2022):

Hmm, I changed the configuration to secret, and looks like it works, but not it has a different problem and I even don't have anything in the logs. Adding verbose is not helping to get something useful too.

[Build and push Nginx/Build and push]   ❌  Failure - Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; }
[Build and push Nginx/Build and push] exitcode '1': failure
[Build and push Nginx/Build and push]   ⚙  ::set-output:: full_command=
[Build and push Nginx/Build and push]   ❌  Failure - Main Install dependencies
<!-- gh-comment-id:1165359872 --> @abagayev commented on GitHub (Jun 24, 2022): Hmm, I changed the configuration to secret, and looks like it works, but not it has a different problem and I even don't have anything in the logs. Adding verbose is not helping to get something useful too. ``` [Build and push Nginx/Build and push] ❌ Failure - Main bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/330b13bbb1eadd05bbb627477c1549cd7e62e406/php-build.bash) composer \ && ${{ github.action_path }}/composer-action.bash || { echo "::group::Debug output" ; cat ${{ github.workspace }}/output.log ; echo "::endgroup::" ; exit 1; } [Build and push Nginx/Build and push] exitcode '1': failure [Build and push Nginx/Build and push] ⚙ ::set-output:: full_command= [Build and push Nginx/Build and push] ❌ Failure - Main Install dependencies ```
Author
Owner

@github-actions[bot] commented on GitHub (Jul 25, 2022):

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

<!-- gh-comment-id:1193425518 --> @github-actions[bot] commented on GitHub (Jul 25, 2022): Issue is stale and will be closed in 14 days unless there is new activity
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#676
No description provided.