From 9ef3dbc1650c7e87192dc87eb50001e017f7bbae Mon Sep 17 00:00:00 2001 From: Shakar <5h4k4r.b4kr@gmail.com> Date: Wed, 13 Sep 2023 14:47:23 +0300 Subject: [PATCH] Add label Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com> --- .github/workflows/main.yaml | 6 ++++-- action.yml | 3 +++ index.js | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a7a8a71..0ba8f2c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,6 +1,8 @@ name: Test Action -on: [push] +on: + pull_request: + types: [labeled] jobs: hello-world-job: @@ -23,6 +25,6 @@ jobs: id: hello with: who-to-greet: "John" - + label: ${{ github.event.label.name }} - name: Get the output time run: echo "The time was ${{ steps.hello.outputs.time }}" diff --git a/action.yml b/action.yml index 95555c6..d400bde 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,9 @@ inputs: description: "Who to greet" required: true default: "World" + label: + description: "Optional label" + required: false outputs: time: # id of output description: "The time we greeted you" diff --git a/index.js b/index.js index 2026cd4..eb7669b 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,8 @@ const github = require('@actions/github'); try { const nameToGreet = core.getInput('who-to-greet'); + const label = core.getInput('label'); + console.log(`Lable: ${label}`) console.log(`Hello ${nameToGreet}!`); const time = (new Date()).toTimeString();