From 5cd99bf9c186219af43341076f1fe9c09e5a9934 Mon Sep 17 00:00:00 2001 From: Michael Shick Date: Mon, 6 Jul 2020 23:27:42 -0400 Subject: [PATCH] docs: clarify proxy notes --- README.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9516d6b..288e68f 100644 --- a/README.md +++ b/README.md @@ -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