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

fatal: unsafe repository ('/github/workspace' is owned by someone else) #132

Closed
derberg opened this issue Apr 13, 2022 · 9 comments
Closed

Comments

@derberg
Copy link

derberg commented Apr 13, 2022

Hey, something wrong started happening few hours ago with the action.

logs:

Cannot find mlc_config.json
NOTE: See https://github.com/tcort/markdown-link-check#config-file-format to know more about
customizing markdown-link-check by using a configuration file.
USE_QUIET_MODE: yes
USE_VERBOSE_MODE: yes
FOLDER_PATH: .
MAX_DEPTH: -1
CHECK_MODIFIED_FILES: yes
FILE_EXTENSION: .md
FILE_PATH: 
BASE_BRANCH: master
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

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

I tried a few workarounds but non of them works: https://github.com/derberg/test-experiment/blob/derberg-patch-20/.github/workflows/links.yml#L16-L20

any ideas?

@labeneko
Copy link
Contributor

I resolved this issue temporary 🙇

  1. fork this repository
  2. add git config --global --add safe.directory /github/workspace to entrypoint.sh
    example: labeneko@2cbe46a
  3. fix yml
    - uses: gaurav-nelson/github-action-markdown-link-check@v1- uses: {your_repository}/github-action-markdown-link-check@master

@dfarrell07
Copy link

There are some more details about this error in a more general context here: actions/checkout#760

@sschuberth
Copy link

Hmm, I've upgraded to checkout action v3, and I've also set git config --global --add safe.directory /github/workspace, but I'm still seeing the error. Any hints?

@creachadair
Copy link
Contributor

Hmm, I've upgraded to checkout action v3, and I've also set git config --global --add safe.directory /github/workspace, but I'm still seeing the error. Any hints?

The difficulty for this action is that it runs git inside Docker, so the place where you need to edit the git config is inside the container. That is why the comment above suggests forking this repository (this is what I've done as a workaround as well).

@sschuberth
Copy link

The difficulty for this action is that it runs git inside Docker, so the place where you need to edit the git config is inside the container

Thanks, that makes sense for the git config --global --add safe.directory /github/workspace part. But should the upgrade to checkout action v3(.0.1) alone have already fixed the issue?

@sschuberth
Copy link

Looks like there's a new issue specifically about failing "in other workflow steps after running checkout".

@nvliyuan
Copy link

Hmm, I've upgraded to checkout action v3, and I've also set git config --global --add safe.directory /github/workspace, but I'm still seeing the error. Any hints?

The difficulty for this action is that it runs git inside Docker, so the place where you need to edit the git config is inside the container. That is why the comment above suggests forking this repository (this is what I've done as a workaround as well).

I tried the comment but it seems the markdown link checker cannot access the reference links, any insight?
image

@creachadair
Copy link
Contributor

I tried the comment but it seems the markdown link checker cannot access the reference links, any insight?

The issue with reference links is not related to the permissions issue, but should be resolved by #129 being merged and released.

@derberg
Copy link
Author

derberg commented Apr 20, 2022

ok, I see 7h ago new v1 tag was created that points to a commit with the fix, so closing this one

@derberg derberg closed this as completed Apr 20, 2022
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Apr 20, 2022
…nk-check"

This reverts commit 7b20661 as the upstream issue has been fixed, see
[1].

[1]: gaurav-nelson/github-action-markdown-link-check#132 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Apr 20, 2022
…nk-check"

This reverts commit 7b20661 as the upstream issue has been fixed, see
[1].

[1]: gaurav-nelson/github-action-markdown-link-check#132 (comment)

Signed-off-by: Sebastian Schuberth <[email protected]>
joshbeard added a commit to joshbeard/jekyll-build-action that referenced this issue May 12, 2022
This sets the 'safe.directory' option for Git to permit running in the
GitHub workspace as expected.

References:
* https://github.blog/2022-04-12-git-security-vulnerability-announced/
* actions/checkout#760
* gaurav-nelson/github-action-markdown-link-check#132
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

6 participants