mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2025-12-15 04:46:22 +00:00
docs: omit github token in docs
This commit is contained in:
parent
832d4d1261
commit
9945cf63fa
4 changed files with 38 additions and 50 deletions
|
|
@ -9,7 +9,6 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
header: FromPR
|
header: FromPR
|
||||||
message: |
|
message: |
|
||||||
Test ${{ github.sha }} is successfully ended.
|
Test ${{ github.sha }} is successfully ended.
|
||||||
|
|
|
||||||
3
.github/workflows/comment_on_push.yml
vendored
3
.github/workflows/comment_on_push.yml
vendored
|
|
@ -9,11 +9,8 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: jwalton/gh-find-current-pr@v1
|
- uses: jwalton/gh-find-current-pr@v1
|
||||||
id: finder
|
id: finder
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
number: ${{ steps.finder.outputs.pr }}
|
number: ${{ steps.finder.outputs.pr }}
|
||||||
message: |
|
message: |
|
||||||
Test ${{ github.sha }} is successfully ended.
|
Test ${{ github.sha }} is successfully ended.
|
||||||
|
|
|
||||||
83
README.md
83
README.md
|
|
@ -22,30 +22,28 @@ In some cases, different actions may require different comments. The header allo
|
||||||
release:
|
release:
|
||||||
...
|
...
|
||||||
- uses: marocchino/sticky-pull-request-comment@v2
|
- uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
header: release
|
||||||
header: release
|
message: |
|
||||||
message: |
|
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
...
|
...
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
id: test
|
id: test
|
||||||
run: |
|
run: |
|
||||||
OUTPUT=$(rake test)
|
OUTPUT=$(rake test)
|
||||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||||
echo "::set-output name=result::$OUTPUT"
|
echo "::set-output name=result::$OUTPUT"
|
||||||
- uses: marocchino/sticky-pull-request-comment@v2
|
- uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
header: test
|
||||||
header: test
|
message: |
|
||||||
message: |
|
```
|
||||||
```
|
${{ steps.test.outputs.result }}
|
||||||
${{ steps.test.outputs.result }}
|
```
|
||||||
```
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Append after comment every time it runs
|
### Append after comment every time it runs
|
||||||
|
|
@ -54,22 +52,21 @@ test:
|
||||||
test:
|
test:
|
||||||
...
|
...
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
id: test
|
id: test
|
||||||
run: |
|
run: |
|
||||||
OUTPUT=$(rake test)
|
OUTPUT=$(rake test)
|
||||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||||
echo "::set-output name=result::$OUTPUT"
|
echo "::set-output name=result::$OUTPUT"
|
||||||
- uses: marocchino/sticky-pull-request-comment@v2
|
- uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
append: true
|
||||||
append: true
|
message: |
|
||||||
message: |
|
Test with ${{ github.sha }}.
|
||||||
Test with ${{ github.sha }}.
|
```
|
||||||
```
|
${{ steps.test.outputs.result }}
|
||||||
${{ steps.test.outputs.result }}
|
```
|
||||||
```
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Comment from push
|
### Comment from push
|
||||||
|
|
@ -78,16 +75,13 @@ If for some reason, triggering on pr is not possible, you can use push.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: jwalton/gh-find-current-pr@v1
|
- uses: jwalton/gh-find-current-pr@v1
|
||||||
id: finder
|
id: finder
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- uses: marocchino/sticky-pull-request-comment@v2
|
- uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
number: ${{ steps.finder.outputs.pr }}
|
||||||
number: ${{ steps.finder.outputs.pr }}
|
message: |
|
||||||
message: |
|
Test ${{ github.sha }} is successfully ended.
|
||||||
Test ${{ github.sha }} is successfully ended.
|
This is message from push.
|
||||||
This is message from push.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Read comment from a file
|
### Read comment from a file
|
||||||
|
|
@ -95,7 +89,6 @@ with:
|
||||||
```yaml
|
```yaml
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
path: path-to-comment-contents.txt
|
path: path-to-comment-contents.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -104,7 +97,6 @@ with:
|
||||||
```yaml
|
```yaml
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
recreate: true
|
recreate: true
|
||||||
message: |
|
message: |
|
||||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||||
|
|
@ -115,7 +107,6 @@ with:
|
||||||
```yaml
|
```yaml
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
delete: true
|
delete: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ inputs:
|
||||||
GITHUB_TOKEN:
|
GITHUB_TOKEN:
|
||||||
description: 'The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to create or update the comment. This defaults to {{ github.token }}.'
|
description: 'The GitHub access token (e.g. secrets.GITHUB_TOKEN) used to create or update the comment. This defaults to {{ github.token }}.'
|
||||||
default: '${{ github.token }}'
|
default: '${{ github.token }}'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: "node12"
|
using: "node12"
|
||||||
main: "dist/index.js"
|
main: "dist/index.js"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue