Skip to content

Commit

Permalink
Merge branch 'master' of github.com:actions/hello-world-javascript-ac…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
rachmari committed Sep 6, 2019
2 parents 714607a + 2b62cf0 commit 030bda0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# action.yml
name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 030bda0

Please sign in to comment.