Skip to content

Commit e89f6c5

Browse files
committed
build: Add the action repo locally.
1 parent ad19e9e commit e89f6c5

5 files changed

Lines changed: 8027 additions & 1 deletion

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:slim
2+
3+
# A bunch of `LABEL` fields for GitHub to index
4+
LABEL "com.github.actions.name"="ResultPoster"
5+
LABEL "com.github.actions.description"="Post a link because it shouldn't be this hard"
6+
LABEL "com.github.actions.icon"="edit"
7+
LABEL "com.github.actions.color"="orange"
8+
LABEL "repository"="http://github.com/nodejs/website-prototype"
9+
LABEL "homepage"="http://github.com/nodejs/website-prototype"
10+
LABEL "maintainer"="Myles Borins (https://github.com/MylesBorins)"
11+
12+
# install
13+
COPY package*.json ./
14+
RUN npm ci --only=production
15+
16+
# start
17+
COPY . .
18+
ENTRYPOINT ["node", "/index.js"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const { Toolkit } = require('actions-toolkit')
2+
const { context, github: { request } } = new Toolkit()
3+
4+
const name = context.payload.check_suite.app.name;
5+
const conclusion = context.payload.check_suite.conclusion
6+
const sha = context.payload.check_suite.head_sha;
7+
const prs = context.payload.check_suite.pull_requests;
8+
9+
if (name === 'Google Cloud Build' && conclusion === 'success' && prs[0]) {
10+
request('POST /repos/:owner/:repo/issues/:number/comments', context.repo({
11+
number: prs[0].number,
12+
body: `Preview at: https://storage.googleapis.com/nodejs-dev-staging/${sha.slice(0,7)}/index.html`
13+
}));
14+
}

0 commit comments

Comments
 (0)