mirror of
https://github.com/actions/hello-world-javascript-action.git
synced 2025-04-07 06:59:37 +00:00
Add comments
This commit is contained in:
2
index.js
2
index.js
@ -2,10 +2,12 @@ const core = require('@actions/core');
|
|||||||
const github = require('@actions/github');
|
const github = require('@actions/github');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// `who-to-greet` input defined in action metadata file
|
||||||
const nameToGreet = core.getInput('who-to-greet');
|
const nameToGreet = core.getInput('who-to-greet');
|
||||||
console.log(`Hello ${nameToGreet}!`);
|
console.log(`Hello ${nameToGreet}!`);
|
||||||
const time = (new Date()).toTimeString();
|
const time = (new Date()).toTimeString();
|
||||||
core.setOutput("time", time);
|
core.setOutput("time", time);
|
||||||
|
// Get the JSON webhook payload for the event that triggered the workflow
|
||||||
const payload = JSON.stringify(github.context.payload, undefined, 2)
|
const payload = JSON.stringify(github.context.payload, undefined, 2)
|
||||||
console.log(`The event payload: ${payload}`);
|
console.log(`The event payload: ${payload}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Reference in New Issue
Block a user