From 166628fc2f7a8ecd28816e5513f3030b44c4e6b8 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:14:48 -0800 Subject: [PATCH] release: Remove condition on event_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was flawed: even though ci.yaml is called by another workflow, the `github` context is associated with the caller workflow¹ so event_name is "workflow_dispatch" during a release run. It doesn't make sense to update the condition to match "workflow_dispatch", since there are valid reasons for running ci.yaml using workflow_dispatch. I think it makes more sense to simply remove this half of the condition as redundant². The other half of the condition sufficiently ensures that the job is run only when called by the release workflow on the default branch. ¹ ² --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 012f104cf..30768b362 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -357,7 +357,7 @@ jobs: release: # Only run when called by the release workflow on the default branch - if: github.event_name == 'workflow_call' && github.workflow_ref == format('{0}/.github/workflows/release.yaml@refs/heads/{1}', github.repository, github.event.repository.default_branch) + if: github.workflow_ref == format('{0}/.github/workflows/release.yaml@refs/heads/{1}', github.repository, github.event.repository.default_branch) needs: [pytest-cram] runs-on: ubuntu-latest steps: