Skip to content

Commit 317fd7f

Browse files
committed
Simplify benchmark workflow checkout and defaults
1 parent 0a0d0cc commit 317fd7f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ on:
77
workflow_dispatch:
88
inputs:
99
ref:
10-
description: "Git ref to benchmark"
10+
description: "Git ref to benchmark; defaults to the version input, then the selected workflow ref"
1111
required: false
12-
default: "main"
12+
default: ""
1313
version:
1414
description: "Version label to publish; defaults to the selected ref"
1515
required: false
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/checkout@v6
5252
with:
5353
fetch-depth: 0
54-
ref: ${{ inputs.ref || 'main' }}
54+
ref: ${{ inputs.ref || inputs.version || github.ref }}
5555

5656
- name: Checkout triggering ref
5757
if: github.event_name != 'workflow_dispatch'
@@ -83,7 +83,7 @@ jobs:
8383
jmh_args=""
8484
publish="true"
8585
else
86-
ref="${INPUT_REF}"
86+
ref="${INPUT_REF:-${INPUT_VERSION:-${GITHUB_REF_NAME}}}"
8787
version="${INPUT_VERSION}"
8888
pattern="${INPUT_PATTERN}"
8989
jmh_args="${INPUT_JMH_ARGS}"

0 commit comments

Comments
 (0)