Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created September 17, 2021 17:43
Show Gist options
  • Save hackintoshrao/27116f33097c32625f69a8818fece26c to your computer and use it in GitHub Desktop.
Save hackintoshrao/27116f33097c32625f69a8818fece26c to your computer and use it in GitHub Desktop.
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 payload = JSON.stringify(github.context.payload, undefined, 2)
console.log(`The event payload: ${payload}`);
} catch (error) {
core.setFailed(error.message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment