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

Workflow runs fail with detected dubious ownership in repository at '/github/workspace' #32

Open
localheinz opened this issue Dec 7, 2022 · 10 comments · Fixed by #35
Open

Comments

@localheinz
Copy link

Workflow runs in FakerPHP/Faker fail using

on:
  pull_request:
  push:
    branches:
      - "main"
      - "[0-9].*"

name: BC Check

jobs:
  roave-bc-check:
    name: Roave BC Check
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Roave BC Check
        uses: docker://nyholm/roave-bc-check-ga

with

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

For reference, see https://github.com/FakerPHP/Faker/actions/runs/3639090757/jobs/6142063932.

@oleksandr-mykhailenko
Copy link

I have the same issue right now

@colinodell
Copy link

This seems to be relevant: actions/runner#2033

@Legion112
Copy link

Legion112 commented Dec 21, 2022

@colinodell do we need to wait for the fix form GitHub action?

I also have the same issue https://github.com/SoftFineWare/discriminator-default-normalizer/actions/runs/3644144924/jobs/6153088587

@samdark
Copy link

samdark commented Jan 16, 2023

Nek- added a commit to Nek-/localise.biz that referenced this issue Mar 12, 2023
@staabm
Copy link

staabm commented Mar 29, 2023

any news on this issue? just ran into it while doing the very first setup with this action/container

@samdark
Copy link

samdark commented Mar 29, 2023

We've fixed it w/ custom workflow we reuse: https://github.com/yiisoft/actions/blob/master/.github/workflows/bc.yml

@staabm
Copy link

staabm commented Mar 29, 2023

running the tool in github action without docker is also twice as fast, so this gave me some nice perf boost on the way :)

thanks - works for me.

@mxr576
Copy link
Contributor

mxr576 commented Jun 1, 2023

I think there is a simple fix for this problem, I am also using this trick in my Docker images. Based on my local testing, it also works here.

Please check #35.

@pimjansen
Copy link

@localheinz the proposed solution is not working here though. I assume it has something to do with the owner of the actions build agent and the volume mount towards this image which holds different ownership.

@Nyholm Nyholm reopened this Jun 14, 2023
@pimjansen
Copy link

I have a running example now that solves this issue (just by configuration). Anyone who could verify the same or has a "better" solution?

on:
  pull_request:
  push:
    branches:
      - "main"
      - "[0-9].*"

name: BC Check

jobs:
  roave-bc-check:
    name: Roave BC Check
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Check for breaking changes
        run: |
          docker run -u $(id -u) -v $(pwd):/app nyholm/roave-bc-check-ga

The main thing is that i added the user flag to the docker engine which is the same user as the existing host. I noticed that in the container UID 0 and GID 0 is used. For the github actions container this is UID 1001 and GID 123 which is the docker group.

By setting the user to the command it runs fine again where there is (as far as i know) no issue in ownership between the checkout and the actual command inside the container (which also holds GIT).

Another solution maybe would be to ignore GIT inside the container but no idea where it is used for though

kenjis added a commit to kenjis/codeigniter4-cache that referenced this issue Sep 7, 2023
"running the tool in github action without docker is also twice as fast"
See Nyholm/roave-bc-check-docker#32 (comment)
kenjis added a commit to kenjis/codeigniter4-cache that referenced this issue Sep 9, 2023
"running the tool in github action without docker is also twice as fast"
See Nyholm/roave-bc-check-docker#32 (comment)
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.

9 participants