From f2e112c9878985d28a8cf1bce0290e89e3c4e466 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:36:38 -0500 Subject: [PATCH 1/6] feat: add inputs to actions --- .github/workflows/test.yml | 5 ++++- action.yml | 5 +++++ index.js | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9ea87c..006b922 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,4 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./ \ No newline at end of file + - uses: ./ + - uses: ./ + with: + person: Remy \ No newline at end of file diff --git a/action.yml b/action.yml index e4a0cc1..b1eb487 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,10 @@ name: DAVV ACTIONS DEMO description: This action greets persons +inputs: + person: + description: 'The person to greet' + required: true + default: Goffy runs: using: node20 main: index.js \ No newline at end of file diff --git a/index.js b/index.js index 0f50426..bc03cca 100644 --- a/index.js +++ b/index.js @@ -1 +1,3 @@ -console.log("hello world"); \ No newline at end of file +const person = process.env.INPUT_PERSON; + +console.log("hello ${person}"); \ No newline at end of file From ca5423760170393d1fe23f0a8407661efaad26b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:41:46 -0500 Subject: [PATCH 2/6] fix: change the naming of variables --- .github/workflows/test.yml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 006b922..aeec9d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,4 +14,4 @@ jobs: - uses: ./ - uses: ./ with: - person: Remy \ No newline at end of file + person: 'Remy' \ No newline at end of file diff --git a/action.yml b/action.yml index b1eb487..aa67398 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ inputs: person: description: 'The person to greet' required: true - default: Goffy + default: 'Goffy' runs: using: node20 main: index.js \ No newline at end of file From fe10b39d7f19de9dc04b2d6ae7adfa4c25cc2275 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:44:58 -0500 Subject: [PATCH 3/6] chore: use single quotes --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bc03cca..2e761cc 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ const person = process.env.INPUT_PERSON; -console.log("hello ${person}"); \ No newline at end of file +console.log('hello ${person}'); \ No newline at end of file From 8743b3cdcb72e0e9eff37ce450f4086b17bb5786 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:48:26 -0500 Subject: [PATCH 4/6] chore: update message --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 2e761cc..0135201 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ const person = process.env.INPUT_PERSON; -console.log('hello ${person}'); \ No newline at end of file +console.log('hello ${person} and: ' + person); \ No newline at end of file From 6027f637742a3d37e1d8302412841106e3639ae8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:53:59 -0500 Subject: [PATCH 5/6] chore: trying with another type of quotes --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0135201..a48391f 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ const person = process.env.INPUT_PERSON; - -console.log('hello ${person} and: ' + person); \ No newline at end of file +const name = "Bing"; +console.log(`Hello, ${name}!`); +console.log('hello ' + person); \ No newline at end of file From 52fbba0ccd11347af20b1ff5e4d5d4e1884b1bb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Dec 2023 15:55:07 -0500 Subject: [PATCH 6/6] feat: two different ways of printing in the javascript console --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index a48391f..79b5742 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ const person = process.env.INPUT_PERSON; -const name = "Bing"; -console.log(`Hello, ${name}!`); +console.log(`Hello, ${person}!`); console.log('hello ' + person); \ No newline at end of file