explain how to "skip" some actions using filter

I just figured this out; might be helpful for other users.
This commit is contained in:
Max Held 2019-05-20 19:49:10 +02:00 committed by GitHub
parent f2cb9e391e
commit 367ec0c61c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,21 @@ act -r
act -v
```
# Skip Actions When Run in `act`
You may sometimes want to skip some actions when you're running a `main.workflow` in act, such as deployment.
You can achieve something similar by using a [filter](https://github.com/actions/bin/tree/master/filter) action, filtering on all [`GITHUB_ACTOR`](https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables)s *except* `nektos/act`, which is the `GITHUB_ACTOR` set by `act`.
```
action "Filter Not Act" {
uses = "actions/bin/filter@3c0b4f0e63ea54ea5df2914b4fabf383368cd0da"
args = "not actor nektos/act"
}
```
Just remember that GitHub actions will cancel all upcoming and concurrent actions on a neutral exit code.
To avoid prematurely cancelling actions, place this filter at the latest possible point in the build graph.
# Support
Need help? Ask on [Gitter](https://gitter.im/nektos/act)!