Simek / yarn-lock-changes

Creates a comment inside Pull Request with the human-readable summary of changes to the Yarn lock file. Works with every Yarn version (classic and berry).
https://github.com/marketplace/actions/yarn-lock-changes
MIT License
132 stars 20 forks source link

Permissions not sufficient within private repositories #57

Closed chrispader closed 2 years ago

chrispader commented 2 years ago

Problem

Using the example in the README.md within private repositories causes the checkout job to crash with the following error:

remote: Repository not found.
Error: fatal: repository 'https://github.com/<your_user>/<your_repo>/' not found

This problem is already tracked here.

Solution

In order to use this action within private repositories, i also needed to add write permissions for id-token and read permissions for contents to the job, as described here, so it looks like something like this:

...

yarn_lock_changes:
    runs-on: ubuntu-latest
    permissions:
        pull-requests: write
        id-token: write
        contents: read

...
klepiz commented 2 years ago

Im having exactly the same issue and after override those permissions it still not working :c Im trying to clone an internal repo

Simek commented 2 years ago

Hello guys, thank you for your issues reports and effort put into creating this issue! 👍

I have tested the action in private repos earlier and it was working for a while, but currently it looks like the actions fails.

Adding the missing permissions, which has been mentioned above and in the checkout repo seems to fix an issue to me. I will add an another section to the "Common Issues" section in Readme, however, this is a problem with GitHub owned action, so I cannot do more there.

Screenshot 2022-07-14 084551

@klepiz It's unfortunate to hear that the adding additional permission did not work in your case, but I'm not sure how I can address that. Can you provide more information (maybe there are some custom settings applied?) an d ensure that you are setting the permission in the correct place?

Simek commented 2 years ago

I'm going to close this issue with the Readme update, since the general approach suggested by @chrispader worked for me.

@klepiz If you still will be experiencing the problems after checking the thing I asked for above, please open new issue with a little bit more details provided, so I can attempt to reproduce the problem. 🙂