Act adds a special environment variable ACT that can be used to skip a step that you don't want to run locally. E.g. a step that posts a Slack message or bumps a version number. You cannot use this method in job level if conditions, see Skipping jobs
- name:Some stepif:${{ !env.ACT }}run:| ...
My workflow always runs the step in gitea actions:
The documentation for nektos act shows:
> Act adds a special environment variable ACT that can be used to skip a step that you don't want to run locally. E.g. a step that posts a Slack message or bumps a version number. You cannot use this method in job level if conditions, see Skipping jobs
>
> ```yaml
>- name: Some step
> if: ${{ !env.ACT }}
> run: |
> ...
> ```
My workflow always runs the step in gitea actions:
```yaml
jobs:
main:
runs-on: ubuntu-latest
steps:
- run: echo "Hello, Runner!"
if: ${{ !env.ACT }}
- run: echo "Hello, Act!"
if: ${{ env.ACT }}
```

Because of this line: https://gitea.com/gitea/act/src/commit/6cdf1e5788dbfa8fe9787a07178c28b64837a61f/pkg/runner/run_context.go#L85
I'm running into this because I'm trying to use act to run my actions locally for testing and only commit working workflows to my repo. Since act and the action runner are based on the same codebase it wasn't hard to track down.
I tried adding the env to my runner.yaml file with no success:
envs:ACT:false
And adding it to my runner's .env also had no effect:
ACT=false
Obviously, because act overwrites it no matter what it is
I'm running into this because I'm trying to use act to run my actions locally for testing and only commit working workflows to my repo. Since act and the action runner are based on the same codebase it wasn't hard to track down.
I tried adding the env to my `runner.yaml` file with no success:
```yaml
envs:
ACT: false
```
And adding it to my runner's `.env` also had no effect:
```env
ACT=false
```
Obviously, because act overwrites it no matter what it is
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The documentation for nektos act shows:
My workflow always runs the step in gitea actions:
Because of this line: https://gitea.com/gitea/act/src/commit/6cdf1e5788dbfa8fe9787a07178c28b64837a61f/pkg/runner/run_context.go#L85
I'm running into this because I'm trying to use act to run my actions locally for testing and only commit working workflows to my repo. Since act and the action runner are based on the same codebase it wasn't hard to track down.
I tried adding the env to my
runner.yamlfile with no success:And adding it to my runner's
.envalso had no effect:Obviously, because act overwrites it no matter what it is