Add label

Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar 2023-09-13 14:47:23 +03:00
parent 73217f0541
commit 9ef3dbc165
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28
3 changed files with 9 additions and 2 deletions

View File

@ -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 }}"

View File

@ -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"

View File

@ -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();