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.
This commit is contained in:
Martin Storsjö committed 2025-05-29 17:27:53 +03:00
1 parent 093d8edefb
commit 7b53b4af23
5 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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: |
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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