question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

on.pull_request.paths-ignore are not respected correctly

See original GitHub issue

Describe the bug

According to the documentation we can use paths-ignore in the same way for pull_request events as we can do for push events on.<push|pull_request|pull_request_target>.<paths|paths-ignore>.

However, if we define a workflow like the following, the behavior differs:

name: Echo Date

on:
  push:
    paths-ignore:
      - 'README.md'
  pull_request:
    types: [opened, synchronize]
    paths-ignore:
      - 'README.md'

jobs:
  echo-date:
    runs-on: ubuntu-latest
    name: "Echo"

    steps:
      - name: Run echo date
        run: |
          echo -e "Hello at $(date -I)"

Although it seems to be working at the beginning when I (1) created a pr, (2) pushed a change on README.md and (3) nothing triggered, the behavior changed as soon as one commit of the pr references a file outside of the paths-ignore list. After a change to a file outside of the paths-ignore list, all following commits trigger the workflow.

Someone else mentioned a problem here as well: https://github.com/actions/runner/issues/545#issuecomment-1321467176

To Reproduce You can find a minimal example here: https://github.com/GRBurst/pull_requests.paths

Steps to reproduce the behavior:

  1. Create an action as above (or fork the example)
  2. Create a new branch and a pr
  3. Add commits, where at least one commit changes a file outside the paths-ignore declaration
  4. Check that all following commits trigger the workflow (the pull_request events triggers, the push does not).

Expected behavior I expect that the conditions to run the actions only take the last commit into account. So if I have commit that changes a file outside the path definition, it triggers the workflow. If a following commit does only changes to files declared in the paths-ignore list, the workflow should not trigger.

Runner Version and Platform

Version of your runner? -> 2.299.1

OS of the machine running the runner? OSX/Windows/Linux/… -> Ubuntu, 22.04.1, LTS

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:19
  • Comments:5

github_iconTop GitHub Comments

13reactions
rene-hermenaucommented, Jan 9, 2023

Can confirm the bug

5reactions
kingthorincommented, Jul 4, 2023

It’s been half a year, any news on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub re-triggering all checks on push irrespective of path
I have a repo with multiple workflows with pull request trigger. on: pull_request: branches: - develop. Paths are also defined so that the ......
Read more >
Skipping GitHub Actions jobs while keeping branch protection ...
If the jobs don't run due to path filtering, GitHub actions considers them pending, not passing, so we won't be able to merge....
Read more >
Help using workflows status checks and paths-ignore
I'm working on a group project for school and was assigned to work on the devops part. The master branch has the protection...
Read more >
Git - git-check-ignore Documentation
This can be used to debug why a path became tracked by e.g. git add . and was not ignored by the rules...
Read more >
Exclude files from pull request diffs | Bitbucket Cloud
Exclude files from appearing in the diff view of a pull request in Bitbucket Cloud by specifying patterns in the 'Excluded files' repository...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found