Skip to content

Commit 3661673

Browse files
committed
ci: check pr status
1 parent 69536c2 commit 3661673

File tree

4 files changed

+851
-0
lines changed

4 files changed

+851
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:slim
2+
3+
COPY package*.json ./
4+
5+
RUN npm ci
6+
7+
COPY entrypoint.js /entrypoint.js
8+
9+
ENTRYPOINT ["node", "/entrypoint.js"]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { Toolkit } = require('actions-toolkit')
2+
3+
const tools = new Toolkit()
4+
5+
const { owner, repo } = tools.context.repo
6+
const { sha } = tools.context
7+
const { status, message, context } = tools.inputs
8+
9+
tools.github.repos
10+
.createStatus({
11+
owner,
12+
repo,
13+
sha,
14+
state: status,
15+
description: message,
16+
context,
17+
target_url: `https://www.github.com/${owner}/${repo}/commit/${sha}/checks`,
18+
})
19+
.then(() => {
20+
tools.exit.success()
21+
})
22+
.catch((err) => {
23+
tools.log.fatal(err)
24+
tools.exit.failure()
25+
})

0 commit comments

Comments
 (0)