Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
bin readability: use filter rather than alternative operator Jan 17, 2019
test handle missing '.issue.labels' in filter Jan 16, 2019
Dockerfile Version bump. Oct 23, 2018
LICENSE Initial commit Oct 16, 2018
Makefile Initial commit Oct 16, 2018
README.md s/synchronized/synchronize Nov 9, 2018
THIRD_PARTY_NOTICE.md Initial commit Oct 16, 2018
entrypoint.sh Add filter entrypoint Oct 16, 2018

README.md

Filters for GitHub Actions

This action includes common filters to stop workflows unless certain conditions are met.

For example, here is a workflow that publishes a package to npm when the master branch receives a push:

workflow "Build, Test, and Publish" {
  on = "push"
  resolves = ["Publish"]
}

action "Build" {
  uses = "actions/npm@master"
  args = "install"
}

action "Test" {
  needs = "Build"
  uses = "actions/npm@master"
  args = "test"
}

# Filter for master branch
action "Master" {
  needs = "Test"
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "Publish" {
  needs = "Master"
  uses = "actions/npm@master"
  args = "publish --access public"
  secrets = ["NPM_AUTH_TOKEN"]
}

Available filters

tag

Continue if the event is a tag.

action "tag-filter" {
  uses = "actions/bin/filter@master"
  args = "tag"
}

Optionally supply a pattern of tags to match:

  args = "tag v*"

branch

Continue if the event is a branch.

action "branch-filter" {
  uses = "actions/bin/filter@master"
  args = "branch"
}

Optionally supply a pattern to match:

  args = "branch stable-*"

ref

Continue if the event ref matches a pattern.

action "branch-filter" {
  uses = "actions/bin/filter@master"
  args = "ref refs/pulls/*"
}

label

Continue if the issue or pull request has the following label

action "label-filter" {
  uses = "actions/bin/filter@master"
  args = "label urgent"
}

action

Continue if the event payload includes a matching action.

action "action-filter" {
  uses = "actions/bin/filter@master"
  args = "action synchronize"
}

This also supports multiple actions.

action "action-filter" {
  uses = "actions/bin/filter@master"
  args = ["action", "opened|synchronize"]
}

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Container images built with this project include third party materials. See THIRD_PARTY_NOTICE.md for details.