-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (29 loc) · 952 Bytes
/
index.js
File metadata and controls
34 lines (29 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const core = require("@actions/core");
const github = require("@actions/github");
async function run() {
try {
const [
gitHubRepoOwner,
gitHubRepoName
] = process.env.GITHUB_REPOSITORY.split("/");
const gitHubSha = process.env.GITHUB_SHA;
const gitHubToken = core.getInput("github-token");
const octokit = new github.GitHub(gitHubToken);
octokit.checks.create({
owner: gitHubRepoOwner,
repo: gitHubRepoName,
name: "Check Created by API",
head_sha: gitHubSha,
status: "completed",
conclusion: "success",
output: {
title: "Check Created by API",
summary: `# All good `
}
});
core.setOutput("time", new Date().toTimeString());
} catch (error) {
core.setFailed(error.message);
}
}
run();