Create comment on pull request, if exists update that comment.
uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
In some cases, different actions may require different comments. The header allows you to maintain comments independently.
release:
...
- uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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"
- uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: test
message: |
```
${{ steps.test.outputs.result }}
```
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"
- uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
append: true
message: |
Test with ${{ github.sha }}.
```
${{ steps.test.outputs.result }}
```
If for some reason, triggering on pr is not possible, you can use push.
- uses: jwalton/gh-find-current-pr@v1
id: finder
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.finder.outputs.pr }}
message: |
Test ${{ github.sha }} is successfully ended.
This is message from push.
uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: path-to-comment-contents.txt
uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
recreate: true
message: |
Release ${{ github.sha }} to <https://pr-${{ github.event.number }}.example.com>
uses: marocchino/sticky-pull-request-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
delete: true
Install the dependencies
$ npm install
Build the typescript
$ npm run build
Run the tests ✔️
$ npm test
PASS ./index.test.js
✓ throws invalid number (3ms)
✓ wait 500 ms (504ms)
✓ test runs (95ms)
...
Actions are run from GitHub repos. We will create a releases branch and only checkin production modules (core in this case).
Comment out node_modules in .gitignore and create a releases/v1 branch
# comment out in distribution branches
# node_modules/
$ git checkout -b releases/v1
$ git commit -a -m "prod dependencies"
$ npm prune --production
$ git add node_modules
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
Your action is now published! 🚀
See the versioning documentation