From 01e2d073e5ff345b0982a9068d0db2cf3e6a38f1 Mon Sep 17 00:00:00 2001 From: Balaji-Sapiens Date: Wed, 29 Oct 2025 15:48:01 +0530 Subject: [PATCH 1/2] Create reusable.yml --- .github/workflows/reusable.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/reusable.yml diff --git a/.github/workflows/reusable.yml b/.github/workflows/reusable.yml new file mode 100644 index 0000000..f095bc8 --- /dev/null +++ b/.github/workflows/reusable.yml @@ -0,0 +1,26 @@ +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 + steps: + - name: Greet someone + run: echo "Hello ${{ inputs.who-to-greet }}" + - name: Set time + id: time + run: echo "time=$(date)" >> $GITHUB_OUTPUT + outputs: + current-time: ${{ steps.time.outputs.time }} + From 2842210fc9741ffd11f8b561aead68d422dff740 Mon Sep 17 00:00:00 2001 From: Balaji-Sapiens Date: Wed, 29 Oct 2025 15:50:37 +0530 Subject: [PATCH 2/2] Create reuse.yml --- .github/workflows/reuse.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/reuse.yml diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000..25d60b9 --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,13 @@ +name: Reuse other workflow + +on: [workflow_dispatch] +jobs: + call-workflow: + uses: ./.github/workflows/reusable.yml + with: + who-to-greet: '@octocat' + use-output: + runs-on: ubuntu-latest + needs: [call-workflow] + steps: + - run: echo "Time was ${{ needs.call-workflow.outputs.current-time }}"