-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from actions/update-actions/github
Update actions/github
- Loading branch information
Showing
7 changed files
with
7,512 additions
and
23,260 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 | ||
}) | ||
} |
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
Oops, something went wrong.