-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Clem
committed
Jun 4, 2020
1 parent
89e3c40
commit 4789b35
Showing
6 changed files
with
7,503 additions
and
23,251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| on: | ||
| pull_request: | ||
| branches: master | ||
| types: [opened, synchronize] | ||
|
|
||
| jobs: | ||
| pull-request-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: ./ | ||
| with: | ||
| script: | | ||
| // Get the existing comments. | ||
| const {data: comments} = await github.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.number, | ||
| }) | ||
| // Find any comment already made by the bot. | ||
| const botComment = comments.find(comment => comment.user.id === 41898282) | ||
| const commentBody = "Hello from actions/github-script! (${{ github.sha }})" | ||
| if (botComment) { | ||
| await github.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: botComment.id, | ||
| body: commentBody | ||
| }) | ||
| } else { | ||
| await github.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.payload.number, | ||
| body: commentBody | ||
| }) | ||
| } |
Oops, something went wrong.