From 3f4a6dc4626eed03991e207b4d0e343b634edf9e Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Tue, 10 Jan 2023 22:43:12 +0100 Subject: [PATCH] test: make sure workflow_call is not a github event calling our workflow (#1520) Since reusable workflows are defining inputs and ouputs using the on.workflow_call syntax, this could also be triggered by a workflow_call event. That event does not exist within GitHub and we should make sure our worklow is not called by that kind of 'synthetic' event. See https://github.com/nektos/act/pull/1423/files/74da5b085c0c4d08c5e5bf53501e555cb585b26c#r1042413431 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../testdata/.github/workflows/local-reusable-workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml index b04fe72da03..a52fdcf3173 100644 --- a/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml +++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml @@ -68,6 +68,11 @@ jobs: echo secrets.secret=${{ secrets.secret }} [[ "${{ secrets.secret == 'keep_it_private' }}" = "true" ]] || exit 1 + - name: test github.event_name is never workflow_call + run: | + echo github.event_name=${{ github.event_name }} + [[ "${{ github.event_name != 'workflow_call' }}" = "true" ]] || exit 1 + - name: test output id: output_test run: |