[GH-ISSUE #1474] env.act not working with github actions #759

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

Originally created by @hholst80 on GitHub (Nov 27, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1474

Bug report info

(env)  ~/D/G/azure-queue-sidecar  master  act --bug-report
act version:            v0.2.27-dev
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            unix:///run/user/1000/docker.sock
Sockets found:
	/run/user/1000/docker.sock
Config files:
	/home/om/.actrc:
		-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
		-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
		--defaultbranch master
Build info:
	Go version:            go1.18.1
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:
	Build settings:
		-compiler:            gc
		CGO_ENABLED:          1
		CGO_CFLAGS:
		CGO_CPPFLAGS:
		CGO_CXXFLAGS:
		CGO_LDFLAGS:
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         87327286d51e8f776e27baadb1eafc3b5382c7f1
		vcs.time:             2022-11-25T10:38:49Z
		vcs.modified:         true
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:                    Ubuntu 22.04.1 LTS
	OS type:               linux
	OS version:            22.04
	OS arch:               x86_64
	OS kernel:             5.19.0-76051900-generic
	OS CPU:                4
	OS memory:             11246 MB
	Security options:
		name=seccomp,profile=default
		name=rootless
		name=cgroupns

Command used with act

not an issue with act but with compability with github actions.

Describe issue

image

No response

Workflow content

name: foo
on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - run: echo building
 deploy:
   runs-on: ubuntu-latest
   if: ${{ !env.ACT }}
   steps:
     - run: echo this only runs in github

Relevant log output

asdf

Additional information

No response

Originally created by @hholst80 on GitHub (Nov 27, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1474 ### Bug report info ```plain text (env) ~/D/G/azure-queue-sidecar master act --bug-report act version: v0.2.27-dev GOOS: linux GOARCH: amd64 NumCPU: 4 Docker host: unix:///run/user/1000/docker.sock Sockets found: /run/user/1000/docker.sock Config files: /home/om/.actrc: -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04 --defaultbranch master Build info: Go version: go1.18.1 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 87327286d51e8f776e27baadb1eafc3b5382c7f1 vcs.time: 2022-11-25T10:38:49Z vcs.modified: true 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: Ubuntu 22.04.1 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.19.0-76051900-generic OS CPU: 4 OS memory: 11246 MB Security options: name=seccomp,profile=default name=rootless name=cgroupns ``` ### Command used with act ```sh not an issue with act but with compability with github actions. ``` ### Describe issue ![image](https://user-images.githubusercontent.com/6200749/204163215-4360d665-1d9d-4698-8222-f650a9ed0d80.png) ### Link to GitHub repository _No response_ ### Workflow content ```yml name: foo on: push jobs: build: runs-on: ubuntu-latest steps: - run: echo building deploy: runs-on: ubuntu-latest if: ${{ !env.ACT }} steps: - run: echo this only runs in github ``` ### Relevant log output ```sh asdf ``` ### Additional information _No response_
kerem 2026-03-01 21:46:08 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@hholst80 commented on GitHub (Nov 27, 2022):

Maybe I misunderstood Github / Act documentation. it seems "if" behaves differently on steps & jobs? can I disable a whole job like this only in Act, but not in Github? It would be nice to just not run the deploy job in Act but run it as usual in Github.

<!-- gh-comment-id:1328358390 --> @hholst80 commented on GitHub (Nov 27, 2022): Maybe I misunderstood Github / Act documentation. it seems "if" behaves differently on steps & jobs? can I disable a whole job like this only in Act, but not in Github? It would be nice to just not run the deploy job in Act but run it as usual in Github.
Author
Owner

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

I'm about to propose to delete this section from the readme: https://github.com/nektos/act#skipping-steps and replace it with https://github.com/nektos/act/issues/720#issuecomment-874759066.
It's not the first time someone misunderstood it

<!-- gh-comment-id:1329418862 --> @ChristopherHX commented on GitHub (Nov 28, 2022): I'm about to propose to delete this section from the readme: https://github.com/nektos/act#skipping-steps and replace it with https://github.com/nektos/act/issues/720#issuecomment-874759066. _It's not the first time someone misunderstood it_
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#759
No description provided.