mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2025-12-14 12:31:14 +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: ./
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: FromPR
|
||||
message: |
|
||||
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: jwalton/gh-find-current-pr@v1
|
||||
id: finder
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: ./
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
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:
|
||||
...
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: release
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
with:
|
||||
header: release
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
|
||||
test:
|
||||
...
|
||||
- name: Run Test
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
header: test
|
||||
message: |
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
with:
|
||||
header: test
|
||||
message: |
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
```
|
||||
|
||||
### Append after comment every time it runs
|
||||
|
|
@ -54,22 +52,21 @@ test:
|
|||
test:
|
||||
...
|
||||
- name: Run Test
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
id: test
|
||||
run: |
|
||||
OUTPUT=$(rake test)
|
||||
OUTPUT="${OUTPUT//'%'/'%25'}【7,6 m】"
|
||||
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
|
||||
echo "::set-output name=result::$OUTPUT"
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
append: true
|
||||
message: |
|
||||
Test with ${{ github.sha }}.
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
with:
|
||||
append: true
|
||||
message: |
|
||||
Test with ${{ github.sha }}.
|
||||
```
|
||||
${{ steps.test.outputs.result }}
|
||||
```
|
||||
```
|
||||
|
||||
### Comment from push
|
||||
|
|
@ -78,16 +75,13 @@ If for some reason, triggering on pr is not possible, you can use push.
|
|||
|
||||
```yaml
|
||||
- uses: jwalton/gh-find-current-pr@v1
|
||||
id: finder
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
id: finder
|
||||
- uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
Test ${{ github.sha }} is successfully ended.
|
||||
This is message from push.
|
||||
with:
|
||||
number: ${{ steps.finder.outputs.pr }}
|
||||
message: |
|
||||
Test ${{ github.sha }} is successfully ended.
|
||||
This is message from push.
|
||||
```
|
||||
|
||||
### Read comment from a file
|
||||
|
|
@ -95,7 +89,6 @@ with:
|
|||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
path: path-to-comment-contents.txt
|
||||
```
|
||||
|
||||
|
|
@ -104,7 +97,6 @@ with:
|
|||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
recreate: true
|
||||
message: |
|
||||
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
|
||||
|
|
@ -115,7 +107,6 @@ with:
|
|||
```yaml
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
delete: true
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ inputs:
|
|||
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 }}'
|
||||
required: false
|
||||
runs:
|
||||
using: "node12"
|
||||
main: "dist/index.js"
|
||||
|
|
|
|||
Loading…
Reference in a new issue