diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index d6252692ad4..f4c245eaf3c 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -92,8 +92,14 @@ jobs: - name: Determine whether to dry run id: dry-run if: > - github.event == 'pull_request' || - github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) run: | # Use of this flag in the github-label-sync command will cause it to only check the validity of the # configuration.