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 — Add pull-request-test workflow · actions/github-script@0cc235a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • pull-request-test.yml
  • 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
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 comments = await github.issues.listComments({
16+
owner: context.repo.owner,
17+
repo: context.repo.repo,
18+
issue_number: context.payload.number,
19+
})
20+
21+
console.log('comments')
22+
console.log(comments)
23+
24+
// Find any comment already made by the bot.
25+
const botComment = comments.find(comment => comment.user.id === 41898282)
26+
const commentBody = "Hello from actions/github-script! (${{ github.sha }})"
27+
28+
if (botComment) {
29+
await github.issues.updateComment({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
comment_id: botComment.id,
33+
body: ""
34+
})
35+
} else {
36+
await github.issues.createComment({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
issue_number: context.payload.number,
40+
body: "Hello from actions/github-script!"
41+
})
42+
}

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.