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

unsafe repository error still present on 1.39.0 #148

Closed
jordanamr opened this issue Apr 15, 2022 · 5 comments · Fixed by #149
Closed

unsafe repository error still present on 1.39.0 #148

jordanamr opened this issue Apr 15, 2022 · 5 comments · Fixed by #149

Comments

@jordanamr
Copy link
Contributor

Hello !
I've run into the unsafe repository error so we bumped to 1.39.0.
After some tests it seems like the issue is still happening :(

Run anothrNick/github-tag-action@1.39.0
  env:
    NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
    NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
    package_version: 9.[2]([censored]?check_suite_focus=true#step:11:2).6
    GITHUB_TOKEN: ***
    WITH_V: true
    SOURCE: main
/usr/bin/docker run --name bcf0907966ec2e0c14a4a86c0b5f90aff7[3]([censored])80_ce5a2a --label 2bcf09 --workdir /github/workspace --rm -e NPM_CONFIG_USERCONFIG -e NODE_AUTH_TOKEN -e package_version -e GITHUB_TOKEN -e WITH_V -e SOURCE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/skillup/skillup":"/github/workspace" 2bcf09:07966ec2e0c1[4]([censored])a4a86c0b[5]([censored])f90aff[7]([censored])3[8]([censored])0
*** CONFIGURATION ***
	DEFAULT_BUMP: minor
	WITH_V: true
	RELEASE_BRANCHES: master,main
	CUSTOM_TAG: 
	SOURCE: main
	DRY_RUN: false
	INITIAL_VERSION: 0.0.0
	TAG_CONTEXT: repo
	PRERELEASE_SUFFIX: beta
	VERBOSE: true
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
Is master a match for 
Is main a match for 
pre_release = true
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
fatal: unsafe repository ('/github/workspace/main' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace/main
@jordanamr
Copy link
Contributor Author

jordanamr commented Apr 15, 2022

May be related to the use of a relative github workspace path (SOURCE param) ?

- name: Tag version
        id: tag
        uses: anothrNick/github-tag-action@1.39.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          WITH_V: true
          SOURCE: main

@jordanamr
Copy link
Contributor Author

Opened a PR.
Another solution would be to find recursively all git folders and adding them as exceptions :
find /github/workspace -name '.git' -type d -exec bash -c 'git config --global --add safe.directory ${0%/.git}' {} \;
I much prefer the option I did in my PR as it's simple.

@sbe-arg
Copy link
Collaborator

sbe-arg commented Apr 19, 2022

Odd that if u use master as your default branch it does not happen.
Great raising this.

@jordanamr
Copy link
Contributor Author

If anyone is stuck on that issue and rely on that action, we forked and fixed that at our company while the author is away :)
Feel free to use skillupco/github-tag-action@1.39.0-skco

@trevor92
Copy link

Hello everyone, this issue looks to be related to this: actions/checkout#766

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

Successfully merging a pull request may close this issue.

3 participants