Why did this workflow trigger?

We have a collection of workflows that trigger builds and deploys depending on a tag push, but I just had our production deploy trigger when a new branch was created, and it doesn’t seem like it should have.

Here’s the relevant bits

name: 'deploy:production'
on:
  create:
    tags:
      - 'v*'
      - '!v*.*.*-*.*'
    branches:
      - 'refs/tags/*'
      - '!refs/heads/*'

jobs:
  filter:
    name: 'deploy:production:filter'
    runs-on: ubuntu-latest
    steps:
      -
        uses: actions/bin/filter@master
        with:
          args: not tag v*.*.*-*.*

  build:
    needs:
      - filter
    name: 'deploy:production:build'
    runs-on: ubuntu-latest
    steps:
      -
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

The full gist is here: https://gist.github.com/fooey/7202e06a06634851380e43283d029808

The ref was refs/heads/release/2019.8 and there wasn’t a tag, so it seems like this should not have been triggered

Do neither of the tags or branches filters work for the on create trigger? Am I using it wrong?

Ideally, we wouldn’t need the actions/bin/filter@master job, but it doesn’t seem like the new tag filtering is powerful enough to replace it

2 Likes

I am asking very similar question here https://github.community/t5/GitHub-Actions/Trigger-to-run-only-when-branch-is-created/td-p/30392 but the responses are a bit slow and uninformative. Let’s wait…

1 Like