-
-
Notifications
You must be signed in to change notification settings - Fork 196
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] Error: Unable to locate the git repository in the given path #1948
Comments
Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience. |
HI @TomOMara from the logs it appears the following error occurred /usr/bin/git rev-parse --is-inside-work-tree
fatal: detected dubious ownership in repository at '/__w/my-repo/my-repo'
To add an exception for this directory, call:
git config --global --add safe.directory /__w/my-repo/my-repo |
Hey @jackton1 - thanks for replying so quick. If I'm interpreting it correctly - there is an ownership issue on the cloned git directory from the previous checkout action, and that is causing a mis-read at changed-files's level. Assuming others will run into the same issue, the snipped below (extended example in above report) might work for them, though I wonder if it'd be smoother to include that step in the cleaned-files action internals. You're deffo better placed to make that call! name: Test Action
on:
push:
workflow_dispatch:
jobs:
build-ota:
container: public.ecr.aws/docker/library/node:18.14.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# ensure changed-files can read repo files from git
- name: Configure Git Safe Directory
run: git config --global --add safe.directory /__w/my-repo/my-repo
- name: Check files changed
id: changed-files-yaml
uses: tj-actions/changed-files@v42
with:
files_yaml: |
src:
- src/**
- '**/*.tsx'
|
Hi @TomOMara, thanks for the suggestion one thing to point out is this is done by the checkout action |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
Hi, i'm encountering the following error when running against a node 18.14.0 or above. The error does not occur at version 18.13.0 or below.
To Reproduce
With the following workflow file:
What OS are you seeing the problem on?
ubuntu-latest or ubuntu-22.04
Expected behavior?
I'd expect there to be no error thrown using any version of node 18. There is no error when using node:18.13.0 or lower
Relevant log output
Has all relevant logs been included?
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: