mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2025-12-14 20:41:15 +00:00
docs: remove workflow_run part
This commit is contained in:
parent
e61538ba96
commit
8b661422ca
1 changed files with 3 additions and 61 deletions
64
README.md
64
README.md
|
|
@ -112,66 +112,8 @@ with:
|
|||
|
||||
### Error: Resource not accessible by integration
|
||||
|
||||
That message means requester has not enough permission. The solution is to split
|
||||
the workflow between the part that can be executed with only read privileges and
|
||||
the part that writes comments. See [this
|
||||
article](https://securitylab.github.com/research/github-actions-preventing-pwn-requests)
|
||||
for more information, and see below example for solution:
|
||||
|
||||
```yaml
|
||||
# test.yml
|
||||
name: Test
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm ci
|
||||
- run: |
|
||||
mkdir -p ./pr
|
||||
echo ${{ github.event.number }} | tee ./pr/number
|
||||
npm run all | tee ./pr/all_result
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
with:
|
||||
name: all
|
||||
path: pr/
|
||||
|
||||
# comment_on_pr.yml
|
||||
name: Comment on PR
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- "Test"
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||
steps:
|
||||
- name: on artifact
|
||||
id: artifact
|
||||
uses: marocchino/on_artifact@v1
|
||||
with:
|
||||
name: all
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
header: All
|
||||
number: ${{ steps.artifact.outputs.number }}
|
||||
message: |
|
||||
```
|
||||
${{ steps.artifact.outputs.all_result }}
|
||||
```
|
||||
```
|
||||
That message means requester has not enough permission. If `secrets.GITHUB_TOKEN`
|
||||
is explicitly passed, this problem can be solved by just deleting that part.
|
||||
|
||||
## Inputs
|
||||
|
||||
|
|
@ -209,7 +151,7 @@ jobs:
|
|||
|
||||
### `GITHUB_TOKEN`
|
||||
|
||||
**Optional**, typically set secrets.GITHUB_TOKEN. If not set, this will use `${{ github.token }}`.
|
||||
**Optional**, You can set [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) here. If not set, this will use `${{ github.token }}`.
|
||||
|
||||
## Outputs
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue