Skip to content

Commit

Permalink
Add pull-request-test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Clem committed Jun 4, 2020
1 parent 89e3c40 commit 4789b35
Show file tree
Hide file tree
Showing 6 changed files with 7,503 additions and 23,251 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pull-request-test.yml
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
})
}
Loading

0 comments on commit 4789b35

Please sign in to comment.