Can't get `ignore-paths:` to do what I want

Hi!

I’m trying to get my workflow skipped if any of the changed paths by a push to the master branch is bundler/CHANGELOG.md. This is what I’m doing:

on:
  push:
    branches:
      - master

    paths-ignore:
      - bundler/CHANGELOG.md

However, it doesn’t seem to be working. See https://github.com/rubygems/rubygems/actions/runs/169757578/workflow, where the workflow run even though the push was changing bundler/CHANGELOG.md.

I think I must be missing something very obvious but I can’t see it.

Thanks so much!

Oh! I think it might be due to the fact that the paths-ignore configuration was introduced in that same push? If this is it, it should no longer be a problem I guess. I’ll verify if the next time it doesn’t happen.

Hi @deivid-rodriguez,

If your commits contains other files which out of ‘path-ignore’ configurations, the push event will be triggered.

For your setting, if you only change in bundler/CHANGELOG.md in master branch, the workflow will NOT be triggered.

As an alternative, you can get the file list from the ${{ github.sha }}(link here), check if the bundler/CHANGELOG.md exists, skip the jobs then.

Thanks.

Mmmmm, right.

Aren’t the docs a bit confusing?

Anytime a path name matches a pattern in paths-ignore , the workflow will not run.

This sounds exactly like what I was interpreting.

Although the example later on actually explains the real behavior.

I’ll try an alternative, thanks!!