Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Reusable workflow

on:
workflow_call:
inputs:
who-to-greet:
description: 'The person to greet'
type: string
required: true
default: World
outputs:
current-time:
description: 'The time when greeting.'
value: ${{ jobs.reusable-job.outputs.current-time }}

jobs:
reusable-job:
runs-on: ubuntu-latest
outputs:
current-time: ${{ steps.time.outputs.time }}
steps:
- name: Greet someone
run: echo "Hello ${{ inputs.who-to-greet }}"
- name: Set time
id: time
run: echo "time=$(date)" >> $GITHUB_OUTPUT