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

Broken due to Detected Dubious Ownership #21

Closed
ripytide opened this issue Sep 2, 2023 · 11 comments
Closed

Broken due to Detected Dubious Ownership #21

ripytide opened this issue Sep 2, 2023 · 11 comments

Comments

@ripytide
Copy link

ripytide commented Sep 2, 2023

The action seems to have started to fail sometime in the last 3 days with the following error message:

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

Unhelpfully, it doesn't show up as a failure in GitHub Actions (likely due to #16 and #10), so the only way I found out it had stopped working was by not seeing any recent commits on my GitLab mirrors.

@clarkmcc
Copy link

clarkmcc commented Sep 5, 2023

I also started getting this error a few days ago. There's an issue with the entrypoint.sh script as well according to these errors, not sure if it's related.

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
/entrypoint.sh: line 7: 1: unbound variable

@grogou
Copy link
Contributor

grogou commented Sep 19, 2023

Guys it is easy to solve, you can contribute to this by adding git config --global --add safe.directory /github/workspace to entrypoint.sh, or just fork this repo. Remember it is open source and you can do it yourself.

@klinkeklinke
Copy link
Contributor

klinkeklinke commented Sep 19, 2023

@SvanBoxel @grogou I'm sorry guys but this didn't work for me. We could do sth like:
git config --global --add safe.directory '*'
...or do the same as before but in another line.

what do you think?

My output:

Run SvanBoxel/[email protected]
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
/entrypoint.sh: line 7: 1: unbound variable
fatal: You are not currently on a branch.
pushing to branch at https://gitlab.com/hr-me-dev-team/hr-me-platform
To push the history leading to the current (detached HEAD)
state now, use

    git push mirror HEAD:<name-of-remote-branch>

jq: error (at <stdin>:0): Cannot index array with string "last_pipeline"
Triggered CI for branch 
Working with pipeline id #
Poll timeout set to 10
jq: error (at <stdin>:[26](https://github.com/hr-me-dev-team/hr-me-b2b-web/actions/runs/6240433297/job/16940525551#step:4:27)2): Cannot index array with string "status"
jq: error (at <stdin>:262): Cannot index array with string "web_url"
Current pipeline status: 
Pipeline finished with status 
Fetching all GitLab pipeline jobs involved
Posting output from all GitLab pipeline jobs
Debug problems by unfolding stages/jobs above

@grogou
Copy link
Contributor

grogou commented Sep 20, 2023

@klinkeklinke and @SvanBoxel did you tested new feature before merging? I can confirm it is not working. Try to find solution and test it before merge.

@SvanBoxel
Copy link
Owner

@grogou if you want to, could you submit a PR with a solution that works for you? For what I tested it works but could be your environment is different. Thanks.

@grogou
Copy link
Contributor

grogou commented Sep 20, 2023

I will try if there will be time, I am here just to help.

@grogou
Copy link
Contributor

grogou commented Sep 20, 2023

I cant understand different environment, I guess it is the same GitHub Actions with your package.

@klinkeklinke
Copy link
Contributor

TL;DR - #23 fixes the issue

II didn't think it would work this way - but I managed to test my code this time just by using my fork as github action in my workflow:
uses: klinkeklinke/gitlab-mirror-and-ci-action@master

I ran several tests - first pushing changes manually and then with a PR on my repository and all worked fine, no dubious ownership problems. The problem was I had to do it before any git command - before the first git checkout in entrypoint.sh. Sorry for not succeeding in testing before (in #22 ).

Hopefully this helps everyone.

@SvanBoxel
Copy link
Owner

@clarkmcc
Copy link

Resolved for me!

@SvanBoxel
Copy link
Owner

Updated to latest release. Thanks all!

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

5 participants