JRubics / poetry-publish

An action to build and publish python package to pypi (https://pypi.org/) using poetry (https://github.com/sdispater/poetry)
BSD 3-Clause "New" or "Revised" License
129 stars 17 forks source link

Detected Git repository, but failed because of dubious ownership #39

Open jeriox opened 1 year ago

jeriox commented 1 year ago

Starting recently, the action (v1.17) fails with the above error message.

JRubics commented 1 year ago

Can you please try to run your pipeline with specifying the version of the action to v1.16 so I can be sure it's introduced in the latest version?

jacobtomlinson commented 1 year ago

I ran into this same problem. Downgrading to v1.16 fixed it.

JRubics commented 1 year ago

Hi, please check this issue: https://github.com/actions/runner-images/issues/6775 and it's solution.

It can be that either underlying image of the Docker container I use or ubuntu-latest runner image are updated to the problematic version. Though, I manage to run the version 1.17 on the github runner ubuntu-latest today without any issue: https://github.com/JRubics/test-poetry-publish/actions/runs/5266622455/jobs/9520782502

Please try to rerun your workflow, and send me the results. If it doesn't solve the ubuntu-latest issue, I'll try upgrading/downgrading Docker image I use. It's just strange that I can't reproduce the issue, that's why I think it depends on the ubuntu version.

jeriox commented 1 year ago

Thanks for looking into this! I just reran the workflow (that uses ubuntu-latest) and it failed again: https://github.com/ephios-dev/ephios/actions/runs/5112100572/jobs/9522533965

JRubics commented 1 year ago

Hi, I still can't reproduce the issue, so I assume it's not up to the image used in the action, but up to the image used for the GitHub runner you are using. Most likely we are in the different geographic locations so we are assigned to the different runners with different version installed. I'd suggest to try using a container for running your actions: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container

Please share the results if you try it :slightly_smiling_face:

jeriox commented 11 months ago

Hi, I still can't reproduce the issue, so I assume it's not up to the image used in the action, but up to the image used for the GitHub runner you are using. Most likely we are in the different geographic locations so we are assigned to the different runners with different version installed. I'd suggest to try using a container for running your actions: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container

Please share the results if you try it 🙂

I ran it inside a python:3.11 container and it fails with the same error message. (https://github.com/ephios-dev/ephios/actions/runs/5580150899/jobs/10196670200)

phackstock commented 11 months ago

Ran into the same issue as @jeriox here: https://github.com/iiasa/ixmp4/actions/runs/5819950650/job/15779337504. Reverting to v1.16 fixed it.

BjornFJohansson commented 7 months ago

Same problem for me, Reverting to v1.16 fixed it.

CM000n commented 6 months ago

Got the same error today with v1.17: https://github.com/DurgNomis-drol/mytoyota/actions/runs/7430456596/job/20220172358

Re-run with debug enabled: https://github.com/DurgNomis-drol/mytoyota/actions/runs/7430456596/job/20220373402

Probably it is caused by this?

WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.

CM000n commented 6 months ago

I just downgraded the GitHub Action to 1.16 and it also works again.

JRubics commented 5 months ago

Guys, when you have time, please try with version 2.0. I still can't reproduce the issue, so your help on testing this will be appreciated :pray:

jeriox commented 5 months ago

Still fails with 2.0 https://github.com/ephios-dev/ephios/actions/runs/7802018763/job/21278474436

Josef-Friedrich commented 4 months ago

I tried v2.0. I could upload my package, but the error message is still there:

https://github.com/Josef-Friedrich/ansible-module-shellmarks/actions/runs/7874928996/job/21485656121

 Installing the current project: shellmarks (3.0.0)
Building shellmarks (3.0.0)
  - Building sdist
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
  - Built shellmarks-3.0.0.tar.gz
  - Building wheel
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
  - Built shellmarks-3.0.0-py3-none-any.whl
Using a plaintext file to store credentials

Publishing shellmarks (3.0.0) to PyPI
 - Uploading shellmarks-3.0.0-py3-none-any.whl 0%
 - Uploading shellmarks-3.0.0-py3-none-any.whl 54%
 - Uploading shellmarks-3.0.0-py3-none-any.whl 100% 
 - Uploading shellmarks-3.0.0.tar.gz 0%
 - Uploading shellmarks-3.0.0.tar.gz 100%