-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
976325f
commit a7b666c
Showing
8 changed files
with
303 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Hello world javascript action | ||
|
||
This action prints "Hello World" or "Hello" + the name of a person to greet to the log. | ||
|
||
## Inputs | ||
|
||
### `who-to-greet` | ||
|
||
**Required** The name of the person to greet. Default `"World"`. | ||
|
||
## Outputs | ||
|
||
### `time` | ||
|
||
The time we greeted you. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: actions/hello-world-javascript-action@e76147da8e5c81eaf017dede5645551d4b94427b | ||
with: | ||
who-to-greet: 'Mona the Octocat' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/******/ /* webpack/runtime/compat */ | ||
/******/ | ||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dtdpa2026 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
console.log("Running test script..."); | ||
console.log("Today is "+new Date()); | ||
console.log("...script run"); | ||
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
name: learn-github-actions | ||
run-name: ${{ github.actor }} is learning GitHub Actions | ||
on: [push] | ||
jobs: | ||
check-bats-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- run: npm install -g bats | ||
- run: bats -v | ||
- run: node index.js | ||
name: 'Hello World' | ||
description: 'Greet someone and record the time' | ||
inputs: | ||
who-to-greet: # id of input | ||
description: 'Who to greet' | ||
required: true | ||
default: 'World' | ||
outputs: | ||
time: # id of output | ||
description: 'The time we greeted you' | ||
runs: | ||
using: 'node20' | ||
main: 'dist/index.js' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters