github.com/nektos/act@v0.2.63/pkg/runner/testdata/actions/node12/index.js (about)

     1  const core = require('@actions/core');
     2  const github = require('@actions/github');
     3  
     4  try {
     5    // `who-to-greet` input defined in action metadata file
     6    const nameToGreet = core.getInput('who-to-greet');
     7    console.log(`Hello ${nameToGreet}!`);
     8    const time = (new Date()).toTimeString();
     9    core.setOutput("time", time);
    10    // Get the JSON webhook payload for the event that triggered the workflow
    11    const payload = JSON.stringify(github.context.payload, undefined, 2)
    12    console.log(`The event payload: ${payload}`);
    13  } catch (error) {
    14    core.setFailed(error.message);
    15  }