Giter Site home page Giter Site logo

Comments (4)

alshedivat avatar alshedivat commented on June 9, 2024

I was just looking at the permissions section of actions-comment-pull-request, noticed the following:

Note that, if the PR comes from a fork, it will have only read permission despite the permissions given in the action for the pull_request event. In this case, you may use the pull_request_target event. With this event, permissions can be given without issue (the difference is that it will execute the action from the target branch and not from the origin PR).

in other words, if anyone besides me opens a PR, the action won't not have the write permission and will fail. most of the contributions are coming from forks, so this is suboptimal. do you know if there's a workaround?

from al-folio.

george-gca avatar george-gca commented on June 9, 2024

I thought that the solution would be creating a token with permission to write PRs and pass it to actions-comment-pull-request, but now I don't think it solves it.

In their repo they recommend using pull_request_target as a way of bypassing this limitation. However GitHub itself doesn't recommend this as it could open holes for security breaches. At least they don't recommend building and writing to PR in the same action with pull_request_target. That's why I splitted it into 2. But the thing is, I don't know how to make the second one only run if the prettier check fails AND pull_request_target triggers, so that we could have the permissions needed without doing build on this workflow.

from al-folio.

george-gca avatar george-gca commented on June 9, 2024

Just opened a question on stackoverflow. Let's see if a solution comes up.

from al-folio.

stale avatar stale commented on June 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from al-folio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.