docs: clarify proxy notes

This commit is contained in:
Michael Shick 2020-07-06 23:27:42 -04:00
parent 495aa57b75
commit 5cd99bf9c1
No known key found for this signature in database
GPG key ID: ADF5BC9704BB4A61

View file

@ -2,9 +2,13 @@
> A GitHub Action which adds a comment to a pull request's issue.
## Limitations
## Features
Due to how GitHub handles permissions in PRs coming from forks you will need to deploy an app if you want to post comments in those situations. [See below](#proxy-for-fork-based-prs).
- Fast, runs in the GitHub Actions node.js runtime; no Docker pull needed.
- Modify issues for PRs merged to master.
- Multiple posts of the same comment optionally allowable.
- Supports emoji 😂😂😂!
- Supports a proxy for fork-based PRs. [See below](#proxy-for-fork-based-prs).
## Usage
@ -56,13 +60,16 @@ jobs:
| repo-token | with | A valid GitHub token, either the temporary token GitHub provides or a personal access token | maybe | |
| repo-token-user-login | with | Define this to save on comment processing time when checking for repeats. GitHub's default token uses `github-actions[bot]` | no | |
| allow-repeats | with | A boolean flag to allow identical messages to be posted each time this action is run | no | false |
| proxy-url | with | A string for your proxy service URL if you'd like this to work with fork-based PRs | no | |
| GITHUB_TOKEN | env | A valid GitHub token, can alternatively be defined in the env | maybe | |
## Proxy for Fork-based PRs
GitHub limits `GITHUB_TOKEN` and other API access token permissions when creating a PR from a fork. This makes it impossible to add comments when your PRs are coming from forks, which is the norm for open source projects. To work around this situation I've created a simple companion app you can deploy to Cloud Run or another environment to proxy the create comment requests and escalate the token privileges.
GitHub limits `GITHUB_TOKEN` and other API access token permissions when creating a PR from a fork. This precludes adding comments when your PRs are coming from forks, which is the norm for open source projects. To work around this situation I've created a simple companion app you can deploy to Cloud Run or another host to proxy the create comment requests with a personal access token you provide.
See this issue: https://github.community/t/github-actions-are-severely-limited-on-prs/18179/4 for more detail.
See this issue: https://github.community/t/github-actions-are-severely-limited-on-prs/18179/4 for more details.
Check out the proxy service here: https://github.com/mshick/add-pr-comment-proxy
**Example**
@ -81,15 +88,3 @@ jobs:
proxy-url: https://add-pr-comment-proxy-94idvmwyie-uc.a.run.app
repo-token: ${{ secrets.GITHUB_TOKEN }}
```
## Features
- Fast, runs in the GitHub Actions node.js runtime; no Docker pull needed.
- Modify issues for PRs merged to master.
- Multiple posts of the same comment optionally allowable.
- Supports emoji 😂😂😂!
## Use Case
- Adding a deployed app URL to a PR issue
- Printing some sort of output to the PR issue for human-readability