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] "unknown revision" when using "path" #987

Closed
3 tasks done
szymonpk opened this issue Feb 16, 2023 · 6 comments
Closed
3 tasks done

[BUG] "unknown revision" when using "path" #987

szymonpk opened this issue Feb 16, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@szymonpk
Copy link

szymonpk commented Feb 16, 2023

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?

I see:

  Error: Unable to locate the previous sha: origin/master
  Error: Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than 50.
  Error: Process completed with exit code 1.

when using this action with `path.

To Reproduce

See this repo PR, with this job.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

Working action.

Relevant log output

See the job output.

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@szymonpk szymonpk added the bug Something isn't working label Feb 16, 2023
@github-actions
Copy link
Contributor

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

@jackton1
Copy link
Member

jackton1 commented Feb 16, 2023

Hi @szymonpk, I believe that’s an incorrect use of the path input, as you’ll also need to specify the same path when using the checkout action or set diff_relative: true in order to get changes relative to a specified directory.

See https://github.com/tj-actions/changed-files/blob/main/.github/workflows/test.yml#L43 and for more information.

@jackton1 jackton1 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 16, 2023
@szymonpk
Copy link
Author

Sorry but it does not show diffs in charts directory. When using path:

        uses: actions/checkout@v3

      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@v35.5.4
        with:
          dir_names: true
          dir_names_exclude_root: true
          dir_names_max_depth: 2
          diff_relative: true
          json: true
          path: charts

I do not want to put the repository in charts.

@jackton1
Copy link
Member

You can pass the charts folder as a filter instead. Checkout the Usage documentation for more information

@szymonpk
Copy link
Author

@jackton1 you mean files? But it exits with error when there are no changes (:exploding_head:)

@jackton1
Copy link
Member

@szymonpk Can you provide more information on what exits?

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