[GH-ISSUE #1467] act completely fails when encountering the newer GITHUB_STATE and GITHUB_OUTPUT file mechanism. #753

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

Originally created by @JoshuaDodds on GitHub (Nov 26, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1467

Bug report info

act version:            0.2.33
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 40
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:
        /root/.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.7
        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.33 -X main.commit=a9298d936c5265461dd8f6322961232b08fc6d12 -X main.date=2022-11-01T02:58:34Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         a9298d936c5265461dd8f6322961232b08fc6d12
                vcs.time:             2022-10-31T02:43:57Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.12
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu 22.04.1 LTS
        OS type:               linux
        OS version:            22.04
        OS arch:               x86_64
        OS kernel:             5.10.102.1-microsoft-standard-WSL2
        OS CPU:                40
        OS memory:             51337 MB
        Security options:
                name=seccomp,profile=default

Command used with act

act -s GITHUB_TOKEN=XXXXXXXXXXXXXXXX

Describe issue

When using the newer github environment files as described here:

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

act completely fails and stops when encountering the new GITHUB_STATE and GITHUB_OUTPUT environment files. The older method with set-output still works but results in a warning in GH actions that:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

I suspect the key to the fix to somewhat be in relation to this message from Github:

Action authors who are using the toolkit should update the @actions/core package to v1.10.0 or greater to get the updated saveState and setOutput functions.

No response

Workflow content

name: CI Workflow

on:
  push:
    tags:
      - '*'
    branches: [ main ]

  workflow_dispatch:

jobs:
  build_and_push:
    if: "!contains(github.event.head_commit.message, 'skip ci')"
    runs-on: ubuntu-22.04
    permissions:
      contents: read
      packages: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: '0'

      - name: Create CalVer tag
        id: calver
        run: |
          echo "tag=$(date +%Y.%m.%d.%H)" >> $GITHUB_OUTPUT
          echo "repo=$(echo ${{ github.repository }} | tr [:upper:] [:lower:])" >> $GITHUB_OUTPUT

Relevant log output

[CI Workflow/build_and_push] 🚀  Start image=catthehacker/ubuntu:act-22.04
[CI Workflow/build_and_push]   🐳  docker pull image=catthehacker/ubuntu:act-22.04 platform= username= forcePull=false
[CI Workflow/build_and_push]   🐳  docker create image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI Workflow/build_and_push]   🐳  docker run image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CI Workflow/build_and_push]   ☁  git clone 'https://github.com/docker/setup-qemu-action' # ref=v2
[CI Workflow/build_and_push]   ☁  git clone 'https://github.com/docker/setup-buildx-action' # ref=v2
[CI Workflow/build_and_push]   ☁  git clone 'https://github.com/docker/login-action' # ref=v2
[CI Workflow/build_and_push]   ☁  git clone 'https://github.com/docker/build-push-action' # ref=v3
[CI Workflow/build_and_push] ⭐ Run Main Checkout repository
[CI Workflow/build_and_push]   🐳  docker cp src=/Development/cerbomoticzgx/. dst=/Development/cerbomoticzgx
[CI Workflow/build_and_push]   ✅  Success - Main Checkout repository
[CI Workflow/build_and_push] ⭐ Run Main Create CalVer tag
[CI Workflow/build_and_push]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/calver] user= workdir=
| /var/run/act/workflow/calver: line 2: $GITHUB_OUTPUT: ambiguous redirect
[CI Workflow/build_and_push]   ❌  Failure - Main Create CalVer tag
[CI Workflow/build_and_push] exitcode '1': failure
[CI Workflow/build_and_push] 🏁  Job failed

Additional information

No response

Originally created by @JoshuaDodds on GitHub (Nov 26, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1467 ### Bug report info ```plain text act version: 0.2.33 GOOS: linux GOARCH: amd64 NumCPU: 40 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /root/.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.7 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.33 -X main.commit=a9298d936c5265461dd8f6322961232b08fc6d12 -X main.date=2022-11-01T02:58:34Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: a9298d936c5265461dd8f6322961232b08fc6d12 vcs.time: 2022-10-31T02:43:57Z vcs.modified: false Docker Engine: Engine version: 20.10.12 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.04.1 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.10.102.1-microsoft-standard-WSL2 OS CPU: 40 OS memory: 51337 MB Security options: name=seccomp,profile=default ``` ### Command used with act ```sh act -s GITHUB_TOKEN=XXXXXXXXXXXXXXXX ``` ### Describe issue When using the newer github environment files as described here: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ act completely fails and stops when encountering the new GITHUB_STATE and GITHUB_OUTPUT environment files. The older method with set-output still works but results in a warning in GH actions that: ```The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/``` I suspect the key to the fix to somewhat be in relation to this message from Github: ```Action authors who are using the toolkit should update the @actions/core package to v1.10.0 or greater to get the updated saveState and setOutput functions.``` ### Link to GitHub repository _No response_ ### Workflow content ```yml name: CI Workflow on: push: tags: - '*' branches: [ main ] workflow_dispatch: jobs: build_and_push: if: "!contains(github.event.head_commit.message, 'skip ci')" runs-on: ubuntu-22.04 permissions: contents: read packages: write steps: - name: Checkout repository uses: actions/checkout@v3 with: fetch-depth: '0' - name: Create CalVer tag id: calver run: | echo "tag=$(date +%Y.%m.%d.%H)" >> $GITHUB_OUTPUT echo "repo=$(echo ${{ github.repository }} | tr [:upper:] [:lower:])" >> $GITHUB_OUTPUT ``` ### Relevant log output ```sh [CI Workflow/build_and_push] 🚀 Start image=catthehacker/ubuntu:act-22.04 [CI Workflow/build_and_push] 🐳 docker pull image=catthehacker/ubuntu:act-22.04 platform= username= forcePull=false [CI Workflow/build_and_push] 🐳 docker create image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI Workflow/build_and_push] 🐳 docker run image=catthehacker/ubuntu:act-22.04 platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [CI Workflow/build_and_push] ☁ git clone 'https://github.com/docker/setup-qemu-action' # ref=v2 [CI Workflow/build_and_push] ☁ git clone 'https://github.com/docker/setup-buildx-action' # ref=v2 [CI Workflow/build_and_push] ☁ git clone 'https://github.com/docker/login-action' # ref=v2 [CI Workflow/build_and_push] ☁ git clone 'https://github.com/docker/build-push-action' # ref=v3 [CI Workflow/build_and_push] ⭐ Run Main Checkout repository [CI Workflow/build_and_push] 🐳 docker cp src=/Development/cerbomoticzgx/. dst=/Development/cerbomoticzgx [CI Workflow/build_and_push] ✅ Success - Main Checkout repository [CI Workflow/build_and_push] ⭐ Run Main Create CalVer tag [CI Workflow/build_and_push] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/calver] user= workdir= | /var/run/act/workflow/calver: line 2: $GITHUB_OUTPUT: ambiguous redirect [CI Workflow/build_and_push] ❌ Failure - Main Create CalVer tag [CI Workflow/build_and_push] exitcode '1': failure [CI Workflow/build_and_push] 🏁 Job failed ``` ### Additional information _No response_
kerem 2026-03-01 21:46:05 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@vhoyer commented on GitHub (Nov 28, 2022):

Can confirm, is happening with me too

<!-- gh-comment-id:1329319641 --> @vhoyer commented on GitHub (Nov 28, 2022): Can confirm, is happening with me too
Author
Owner

@ReenigneArcher commented on GitHub (Nov 28, 2022):

Same issue.

echo "root_path=$PWD" >> $GITHUB_OUTPUT

gives:

| /var/run/act/workflow/root.sh: line 2: $GITHUB_OUTPUT: ambiguous redirect
<!-- gh-comment-id:1329807695 --> @ReenigneArcher commented on GitHub (Nov 28, 2022): Same issue. ```bash echo "root_path=$PWD" >> $GITHUB_OUTPUT ``` gives: ```txt | /var/run/act/workflow/root.sh: line 2: $GITHUB_OUTPUT: ambiguous redirect ```
Author
Owner

@djanowski commented on GitHub (Nov 30, 2022):

Works for me after installing latest master, e.g.brew install act --HEAD.

<!-- gh-comment-id:1332290114 --> @djanowski commented on GitHub (Nov 30, 2022): Works for me after installing latest master, e.g.`brew install act --HEAD`.
Author
Owner

@vhoyer commented on GitHub (Nov 30, 2022):

so we need a release?

<!-- gh-comment-id:1332300083 --> @vhoyer commented on GitHub (Nov 30, 2022): so we need a release?
Author
Owner

@ChristopherHX commented on GitHub (Nov 30, 2022):

I would suggest to fix your workflow to check for existence of env GITHUB_OUTPUT before writing to an unset env variable.

act v0.2.34 ( eta 2022 / 12 / 1 ) includes this feature, the older issues has already been closed.

Duplicate of #1386

<!-- gh-comment-id:1332430524 --> @ChristopherHX commented on GitHub (Nov 30, 2022): I would suggest to fix your workflow to check for existence of env GITHUB_OUTPUT before writing to an unset env variable. act v0.2.34 ( eta 2022 / 12 / 1 ) includes this feature, the older issues has already been closed. Duplicate of #1386
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#753
No description provided.