From db413361f78c836c190b112dafbbc1a1991dff52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvaro=20Mu=C3=B1oz?= Date: Thu, 8 Feb 2024 15:11:39 +0100 Subject: [PATCH] Add Reusable Workflow test --- .../.github/workflows/calling_workflow.yml | 18 ++++++++++++++++++ .../.github/workflows/reusable_workflow.yml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 ql/lib/test/.github/workflows/calling_workflow.yml create mode 100644 ql/lib/test/.github/workflows/reusable_workflow.yml diff --git a/ql/lib/test/.github/workflows/calling_workflow.yml b/ql/lib/test/.github/workflows/calling_workflow.yml new file mode 100644 index 00000000000..3b0ab8f18d3 --- /dev/null +++ b/ql/lib/test/.github/workflows/calling_workflow.yml @@ -0,0 +1,18 @@ +on: push + +jobs: + call-workflow-1-in-local-repo: + uses: octo-org/this-repo/.github/workflows/reusable_workflow.yml@172239021f7ba04fe7327647b213799853a9eb89 + with: + config-path: ${{ github.event.pull_request.head.ref }} + secrets: inherit + call-workflow-2-in-local-repo: + uses: ./.github/workflows/reusable_workflow.yml + with: + config-path: ${{ github.event.pull_request.head.ref }} + secrets: inherit + call-workflow-in-another-repo: + uses: octo-org/another-repo/.github/workflows/workflow.yml@v1 + with: + config-path: ${{ github.event.pull_request.head.ref }} + secrets: inherit diff --git a/ql/lib/test/.github/workflows/reusable_workflow.yml b/ql/lib/test/.github/workflows/reusable_workflow.yml new file mode 100644 index 00000000000..f31c8a63d74 --- /dev/null +++ b/ql/lib/test/.github/workflows/reusable_workflow.yml @@ -0,0 +1,18 @@ +name: Reusable workflow example + +on: + workflow_call: + inputs: + config-path: + required: true + type: string + secrets: + token: + required: true + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - id: sink + run: echo ${{ inputs.config-path }}