Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I configure a GitHub Actions workflow so it does not run on a tag push?

I’d like to configure a GitHub Actions workflow so that it runs on branch pushes, but not tag pushes. I thought this would work:

on:
  push:
    tags-ignore: ['**']

But then the workflow failed to run when I pushed a branch, too. Is there a way to configure it so that it runs on a branch push but not a tag push?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Unintuitively, to avoid the tags, you have to tell it to run on all the branches instead. See its use in psycopg for instance.


on:
  push:
    branches:
      - "*"
  pull_request:
  schedule:
    - cron: '48 6 * * *'

The docs say:

If you define only tags/tag-ignore or only branches/branches-ignore, the workflow won’t run for events affecting the undefined Git ref.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading