Skip to content

Commit e0470bd

Browse files
committed
My first action is ready
1 parent a7593d4 commit e0470bd

File tree

342 files changed

+76938
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+76938
-1
lines changed

Diff for: README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
# hello-world-javascript-action
1+
# Hello world javascript action
2+
3+
This action prints "Hello World" or "Hello" + the name of a person to greet to the log.
4+
5+
## Inputs
6+
7+
## `who-to-greet`
8+
9+
**Required** The name of the person to greet. Default `"World"`.
10+
11+
## Outputs
12+
13+
## `time`
14+
15+
The time we greeted you.
16+
17+
## Example usage
18+
19+
uses: actions/[email protected]
20+
with:
21+
who-to-greet: 'Mona the Octocat'

Diff for: action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'node16'
13+
main: 'index.js'

Diff for: index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

Diff for: node_modules/.package-lock.json

+218
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: node_modules/@actions/core/LICENSE.md

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)