File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ]
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments