diff --git a/README.md b/README.md index 4aab487a..390be269 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Hello world JavaScript action -This action prints "Hello World" or "Hello" + the name of a person to greet to the log. +This action prints "Hello World" or "Hello" + the name of a person to greet to the log. To learn how this action was built, see "[Creating a JavaScript action](https://help.github.com/en/articles/creating-a-javascript-action)" in the GitHub Help documentation. ## Inputs diff --git a/action.yml b/action.yml index a7fb731e..07218b75 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,3 @@ -# action.yml name: 'Hello World' description: 'Greet someone and record the time' inputs: diff --git a/index.js b/index.js index 7ebcb446..723a82e9 100644 --- a/index.js +++ b/index.js @@ -2,10 +2,12 @@ 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) {