Skip to content

Combine path and tags conditionals #26273

Answered by Yanjingzhu
phw asked this question in Actions
Discussion options

You must be logged in to vote

Thank you for posting this question in Github Community forum.

Based on your requirement: The expecation would be that this runs on any push that changes src/** and also on an tag release-* independent of the paths in the changed commit.

You can add branches filter with paths and tags together:

on:
  push:
    paths:
      - 'src/**'
    branches:
      - master
    tags:
      - 'release-*'

Please note that:

1. Path filters are not evaluated for pushes to tags. You can found this sentence here.

This could explain that when you use path filter only, when you tag a commit that does not contain changes to src/** the workflow also runs on pushing this tag.

on:

  push:

    paths:

    - ‘src/**’

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dayjaby
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
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
Labels
None yet
4 participants