Skip to content

Commit

Permalink
Merge pull request #57 from actions/update-actions/github
Browse files Browse the repository at this point in the history
Update actions/github
  • Loading branch information
jclem authored Jun 4, 2020
2 parents 89e3c40 + fa718ed commit 6e5ee1d
Show file tree
Hide file tree
Showing 7 changed files with 7,512 additions and 23,260 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
})
}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The return value of the script will be in the step's outputs under the
"result" key.

```yaml
- uses: actions/github-script@v1
- uses: actions/github-script@v2
id: set-result
with:
script: return "Hello!"
Expand All @@ -52,7 +52,7 @@ output of a github-script step. For some workflows, string encoding is preferred
`result-encoding` input:

```yaml
- uses: actions/github-script@v1
- uses: actions/github-script@v2
id: my-script
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -78,7 +78,7 @@ jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v1
- uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand All @@ -101,7 +101,7 @@ jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v1
- uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand All @@ -122,7 +122,7 @@ jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v1
- uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v1
- uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v1
- uses: actions/github-script@v2
with:
script: |
const path = require('path')
Expand Down
Loading

0 comments on commit 6e5ee1d

Please sign in to comment.