From 7b53b4af23f66701fac3dbf30a22d6a58376f054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 29 May 2025 14:07:42 +0300 Subject: [PATCH] github: Fix specifying a commit rather than a branch for manual jobs As the branch field has a default value "master", this default not only applies when the dialog box for starting the manual workflow is presented. But even if the prefilled branch field is cleared, the default value also gets substituted when submitting. In this case, when the commit and branch fields are mutually exclusive, we can't easily have a default. Instead change the uses of the fields, ignoring the branch field if the commit field is filled. If the dawidd6/action-download-artifact action would support specifying either a commit or a branch in the same field, like actions/checkout does, we wouldn't need this distinction at all; this request is tracked upstream at https://github.com/dawidd6/action-download-artifact/issues/242. --- .github/workflows/docker.yml | 4 ++-- .github/workflows/msvcrt.yml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/test-libcxx.yml | 4 ++-- .github/workflows/test-llvm.yml | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e9db121..02a061b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: push name: parameters - name: Get build parameters @@ -85,7 +85,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: push name: linux-ucrt-.* name_is_regexp: true diff --git a/.github/workflows/msvcrt.yml b/.github/workflows/msvcrt.yml index 1a9a54a..f93680a 100644 --- a/.github/workflows/msvcrt.yml +++ b/.github/workflows/msvcrt.yml @@ -35,7 +35,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: push name: parameters - name: Get build parameters @@ -58,7 +58,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: push name: linux-ucrt-x86_64-toolchain - name: Unpack original toolchain diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a525ec7..87dda4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: push - name: Rearrange files run: | diff --git a/.github/workflows/test-libcxx.yml b/.github/workflows/test-libcxx.yml index 7f54c20..5279b3f 100644 --- a/.github/workflows/test-libcxx.yml +++ b/.github/workflows/test-libcxx.yml @@ -30,7 +30,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: ${{inputs.pipeline_type}} name: parameters - name: Get build parameters @@ -60,7 +60,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: ${{inputs.pipeline_type}} name: windows-ucrt-${{matrix.arch}}-toolchain - name: Unpack toolchain diff --git a/.github/workflows/test-llvm.yml b/.github/workflows/test-llvm.yml index d9a0d5c..e1d5667 100644 --- a/.github/workflows/test-llvm.yml +++ b/.github/workflows/test-llvm.yml @@ -30,7 +30,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: ${{inputs.pipeline_type}} name: parameters - name: Get build parameters @@ -58,7 +58,7 @@ jobs: workflow: build.yml workflow_conclusion: success commit: ${{inputs.commit}} - branch: ${{inputs.branch}} + branch: ${{inputs.commit == '' && inputs.branch || ''}} event: ${{inputs.pipeline_type}} name: windows-ucrt-${{matrix.arch}}-toolchain - name: Unpack toolchain