Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Pilot Lvl 1
Message 1 of 2

Feature request: Add more filters to event triggers

The events push|pull_request have support for extended filtering on branches/tags and paths. I need similar filters for other events like deployment or release.

 

on:
  release:
    types: [published]
    ref:
      - '*/foo'
      - 'bar-*' 

This will only trigger for published releases, that have a Git ref value `*/foo` or `bar-*`.

 

on:
  deployment:
    payload:
      - service_name: 'foobar'

This example will only trigger on a deployment event with a payload key service_name which has a value foobar.

 

My codebase is a rather large monorepo with 20+ different services. Without any filtering anytime I trigger the deployment event all workflow files are being executed. I filter stop the job by filtering with an if conditional:

 

on:
  deployment:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - if: github.event.deployment.payload.service_name == 'foobar'
        uses: ./.github/actions/deploy
        with:
          service_name: 'foobar'

I could put the logic that determines which service to deploy into my custom deploy action, yes. That would still leave me with 20+ workflow runs when in reality only one service is deployed.

1 Reply
Moderator
Message 2 of 2

Re: Feature request: Add more filters to event triggers

Hi @riker09,

 

Thanks for this feedback! We're always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I've logged your feature request in our internal feature request list. Though I can't guarantee anything or share a timeline for this, I can tell you that it's been shared with the appropriate teams for consideration.

 

Cheers!