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

Detect changes against most recent commit in PR instead of just on push #249

Open
weiligao opened this issue Sep 5, 2024 · 2 comments
Open

Comments

@weiligao
Copy link

weiligao commented Sep 5, 2024

Currently it's only possible to detect changes against most recent commit if triggered by push using base: ${{ github.ref }}, it would be nice if it would also be supported for trigger pull_request.

@flucrezia
Copy link

flucrezia commented Oct 16, 2024

I think I'm running into this issue but I am not sure.

I have the following:

on: 
  pull_request:
    branches:
      - master
      - release/*
...
jobs:
  update-dockers:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
...
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Filter Dockerfile changes
        uses: $dorny/paths-filter@v3
        id: filter
        with:
          list-files: shell
          filters: |
            dockerfile:
              - added|modified: 'Dockerfile.*'

Then I push on a PR branch a change that affects a file detected by the filter (at lease on push events):

::group::Fetching list of changed files for PR#492 from Github API
Invoking listFiles(pull_number: 492, per_page: 100)
Received 2 items
[changed] .gitea/workflows/main.yml
[changed] Dockerfile.deb11.6
::endgroup::
Detected 2 changed files
Results:
::group::Filter dockerfile = false
Matching files: none
::endgroup::
Changes output set to []

There is any matching, but Dockerfile.deb11.6 should have matched!
Am I missing something ?
Many thanks,
Francesco

@flucrezia
Copy link

Sorry, I found the problem. Replacing:
- added|modified: 'Dockerfile.*'
With:
- added|modified|changed: 'Dockerfile.*'

Make it worked.

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

2 participants