Skip to content

Commit ffff1a2

Browse files
authored
fix checkout-ref - don't fall back to the main branch! Use the ref of the event that triggered the action (github.ref) (#27)
1 parent 1298d6a commit ffff1a2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

.github/workflows/run_gradle_task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Checkout the repo
5959
uses: actions/checkout@v4
6060
with:
61-
ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }}
61+
ref: ${{ inputs.checkout-ref || github.ref }}
6262

6363
- name: Validate Gradle Wrapper
6464
uses: gradle/wrapper-validation-action@v1

.github/workflows/run_publish_maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
runs-on: macos-latest # only macOS supports building all Kotlin targets
4242
gradle-task: >-
4343
publishAllPublicationsToSonatypeReleaseRepository --stacktrace --no-configuration-cache --no-parallel
44-
checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }}
44+
checkout-ref: ${{ inputs.checkout-ref }}

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
runs-on: ${{ matrix.os }}
3535
gradle-task: >-
3636
${{ matrix.task }} --stacktrace
37-
checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }}
37+
checkout-ref: ${{ inputs.checkout-ref }}

.github/workflows/workflow_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
packages: write
3838
checks: write
3939
with:
40-
checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }}
40+
checkout-ref: ${{ inputs.checkout-ref }}

0 commit comments

Comments
 (0)