GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #57 from actions/update-actions/github · avdim/github-script@6e5ee1d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • pull-request-test.yml
  • README.md
  • dist
    • index.js
  • package-lock.json
  • package.json
  • src
    • async-function.ts
    • main.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/pull-request-test.yml‎

Copy file name to clipboard
+39Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
pull_request:
3+
branches: master
4+
types: [opened, synchronize]
5+
6+
jobs:
7+
pull-request-test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: ./
12+
with:
13+
script: |
14+
// Get the existing comments.
15+
const {data: comments} = await github.issues.listComments({
16+
owner: context.repo.owner,
17+
repo: context.repo.repo,
18+
issue_number: context.payload.number,
19+
})
20+
21+
// Find any comment already made by the bot.
22+
const botComment = comments.find(comment => comment.user.id === 41898282)
23+
const commentBody = "Hello from actions/github-script! (${{ github.sha }})"
24+
25+
if (botComment) {
26+
await github.issues.updateComment({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
comment_id: botComment.id,
30+
body: commentBody
31+
})
32+
} else {
33+
await github.issues.createComment({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
issue_number: context.payload.number,
37+
body: commentBody
38+
})
39+
}
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The return value of the script will be in the step's outputs under the
3333
"result" key.
3434

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

5454
```yaml
55-
- uses: actions/github-script@v1
55+
- uses: actions/github-script@v2
5656
id: my-script
5757
with:
5858
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -78,7 +78,7 @@ jobs:
7878
comment:
7979
runs-on: ubuntu-latest
8080
steps:
81-
- uses: actions/github-script@v1
81+
- uses: actions/github-script@v2
8282
with:
8383
github-token: ${{secrets.GITHUB_TOKEN}}
8484
script: |
@@ -101,7 +101,7 @@ jobs:
101101
apply-label:
102102
runs-on: ubuntu-latest
103103
steps:
104-
- uses: actions/github-script@v1
104+
- uses: actions/github-script@v2
105105
with:
106106
github-token: ${{secrets.GITHUB_TOKEN}}
107107
script: |
@@ -122,7 +122,7 @@ jobs:
122122
welcome:
123123
runs-on: ubuntu-latest
124124
steps:
125-
- uses: actions/github-script@v1
125+
- uses: actions/github-script@v2
126126
with:
127127
github-token: ${{secrets.GITHUB_TOKEN}}
128128
script: |
@@ -166,7 +166,7 @@ jobs:
166166
diff:
167167
runs-on: ubuntu-latest
168168
steps:
169-
- uses: actions/github-script@v1
169+
- uses: actions/github-script@v2
170170
with:
171171
github-token: ${{secrets.GITHUB_TOKEN}}
172172
script: |
@@ -195,7 +195,7 @@ jobs:
195195
runs-on: ubuntu-latest
196196
steps:
197197
- uses: actions/checkout@v2
198-
- uses: actions/github-script@v1
198+
- uses: actions/github-script@v2
199199
with:
200200
script: |
201201
const path = require('path')

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.