Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the difference of using the on.pull_request.paths github action syntax? #107

Open
fernandomora opened this issue Oct 5, 2021 · 4 comments

Comments

@fernandomora
Copy link

According to github actions documentation:

https://docs.github.com/es/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths

on.<push|pull_request>.paths

When using the push and pull_request events, you can configure a workflow to run when at least one file does not match paths-ignore or at least one modified file matches the configured paths. Path filters are not evaluated for pushes to tags.

Is this github action providing some extra functionality or different behaviour?

@SVilgelm
Copy link

so, I can answer for this question

The difference is that the workflow will not be executed at all for on.<push|pull_request>.paths
but using the paths-filter executes the jobs

I cannot use on.<push|pull_request>.paths because the checks marked as required, but since the workflow is not executed, I cannot merge a PR

but if I use paths-filter then GitHub executes the workflow but marks the jobs as skipped
Here is my config

name: PR Lint

on:
  pull_request:

jobs:
  check-changes:
    runs-on: ubuntu-latest
    outputs:
      go:  ${{ steps.changes.outputs.go }}
    steps:
      - uses: dorny/paths-filter@v2
        id: changes
        with:
          filters: |
            go:
              - '**.go'
  lint:
    runs-on: ubuntu-latest
    needs: check-changes
    if: ${{ needs. check-changes.outputs.go == 'true' }}
    steps:
     .....

@FezVrasta
Copy link

@SVilgelm we also have required jobs but when we skip them using your action they still block the PR from being merged. Has something changed in the way GitHub works?

@SVilgelm
Copy link

SVilgelm commented Dec 22, 2023

Sorry, this is not my action. I just was lucky to known the answer. I'm not sure I can help you, didn't touch the actions for a year or so. But I can try, could you please share your config?

@FezVrasta
Copy link

I found out the problem in my case is that I'm using matrix and that doesn't work because it ends up skipping the wrong thing

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

No branches or pull requests

3 participants