Skip to content

How to trigger action from release, ignoring specific tags #25312

Answered by BrightRan
alexfoxy asked this question in Actions
Discussion options

You must be logged in to vote

@alexfoxy,

Tag filters are not evaluated for release event, they are only available to push event and pull_request event. To view more details, you can see here.

As the workaround, you can try using the if conditional to skip the jobs in the workflow.
The github.ref of the workflow run triggered by the release event is the released tag, you can use the job-level if conditional (jobs.<job_id>.if) to skip the jobs in the workflow according to the version of the tag.
For example:

  1. deploy-staging
on:
  release:
    types: [created]
jobs:
  deploy_staging:
    if: ${{ contains(github.ref, '-beta') }}
    . . .
    steps:
      ---- execute steps for deploy_staging ----
  1. deploy-production
on…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants