-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
18 lines (17 loc) · 771 Bytes
/
index.js
File metadata and controls
18 lines (17 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const core = require("@actions/core");
const github = require("@actions/github");
try {
// `who-to-greet` input defined in action metadata file
const nameToGreet = core.getInput("who-to-greet");
console.log(`Hello ${nameToGreet}!`);
const time = new Date().toTimeString();
core.setOutput("time", time);
// Get the JSON webhook payload for the event that triggered the workflow
// const pull_request = github.context.payload.pull_request;
const prNumber = github.context.payload.pull_request.number;
const title = github.context.payload.pull_request.title;
console.log(`Pull request data: PR-${prNumber}: ${title}`);
console.log(`Event context: ${JSON.stringify(github.context, undefined, 2)}`);
} catch (error) {
core.setFailed(error.message);
}