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

[BUG] Glob Pattern Incorrect? #433

Closed
3 tasks done
stumpylog opened this issue Mar 15, 2022 · 7 comments
Closed
3 tasks done

[BUG] Glob Pattern Incorrect? #433

stumpylog opened this issue Mar 15, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@stumpylog
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

When using the tj-actions/changed-files@v18.1 I do not see any files listed as being change. The CI log also reports a warning about glob patterns that I suspect is related.

To Reproduce

  1. Make a commit with a change in a directory configured to be examined for changed files
  2. Trigger the action
  3. See no changed files listed

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

The changed file should be listed.

Relevant log output

Run tj-actions/changed-files@v18.1
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.8
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/paperless-ngx/paperless-ngx
/usr/bin/git diff --diff-filter=D --name-only bbe463b65760009411dd51d22ec4e8e1dbba89bd bbe463b65760009411dd51d22ec4e8e1dbba89bd
Warning: No match found for specified patterns. Ensure that subdirectory patterns a prefixed with "**/". See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

Anything else?

Action steps:

          -
    name: Get changed files
    id: changed-files-specific
    uses: tj-actions/changed-files@v18.1
    with:
      files: |
        - src/**
  -
    name: List all changed files
    run: |
      for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do
        echo "${file} was changed"
      done

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stumpylog stumpylog added the bug Something isn't working label Mar 15, 2022
@github-actions
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience.

@jackton1
Copy link
Member

@stumpylog based on the yml configuration you have above you’ll need to remove hyphens - from the list of file patterns

@stumpylog
Copy link
Author

That does resolve the warning. However, I still see no file changed listing.

For example this commit makes a change in the directory I want to monitor. However, in the run I see no changed files listed at all. any_changed also doesn't seem to be set true, as the publishing of coverage data is skipped.

@stumpylog
Copy link
Author

stumpylog commented Mar 15, 2022

Ah, it's using the same commit to do the diff:

Retrieving changes between b5ae4e517ef1745472fe9cff1dce1772380b6bb8 (dev) → b5ae4e517ef1745472fe9cff1dce1772380b6bb8

@jackton1
Copy link
Member

jackton1 commented Mar 15, 2022

Curious to know if this was triggered by a push event ?

@stumpylog
Copy link
Author

That run was. I think I needed to update fetch-depth of my checkout.

@stumpylog
Copy link
Author

Yes, with a fetch-depth=2, this worked. I assume a pull_request event wouldn't need that.

So this was all user error. Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants