Skip to content

Need help with conditional workflows using paths #25423

Answered by y4m4p
y4m4p asked this question in Actions
Discussion options

You must be logged in to vote

I figured it out…

Writing with ignore-path will not run the workflow if and only if the changed files are under those certain paths.

on:
  push:
    branches:
      - master
    ignore-paths:
      - 'nginx/**'

But, by writing the path using ! like below, this will never run the workflow when there are changes under that specified path.
This enables me to condition the workflow which will never run, even when there are other file changes.

This was the behaviour I wanted.

on:
  push:
    branches:
      - master
    paths:
      - '!nginx/**'

Thank you for your help, chirspat :slight_smile:

Replies: 7 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants