From e9b3ae9b862e86e784d6215087ee073f6e88d8cc Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:08:16 +0100 Subject: [PATCH 1/3] fix checkout-ref - don't fall back to the main branch! Use the ref of the event that triggered the action (`github.ref`) --- .github/workflows/run_gradle_task.yml | 2 +- .github/workflows/run_publish_maven.yml | 3 ++- .github/workflows/run_publish_site.yml | 2 +- .github/workflows/run_tests.yml | 2 ++ .github/workflows/workflow_release.yml | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_gradle_task.yml b/.github/workflows/run_gradle_task.yml index 276aa589..452e7aa6 100644 --- a/.github/workflows/run_gradle_task.yml +++ b/.github/workflows/run_gradle_task.yml @@ -58,7 +58,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v3 with: - ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }} + ref: ${{ inputs.checkout-ref || github.ref }} - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/run_publish_maven.yml b/.github/workflows/run_publish_maven.yml index 4cc92622..419d1a41 100644 --- a/.github/workflows/run_publish_maven.yml +++ b/.github/workflows/run_publish_maven.yml @@ -30,6 +30,7 @@ permissions: jobs: sonatype-release: + if: github.ref == 'refs/heads/main' permissions: contents: read packages: write @@ -40,4 +41,4 @@ jobs: runs-on: macos-latest # only macOS supports building all Kotlin targets gradle-task: >- publishAllPublicationsToSonatypeReleaseRepository --stacktrace --no-configuration-cache --no-parallel - checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }} + checkout-ref: ${{ inputs.checkout-ref }} diff --git a/.github/workflows/run_publish_site.yml b/.github/workflows/run_publish_site.yml index 172a5991..638a4a60 100644 --- a/.github/workflows/run_publish_site.yml +++ b/.github/workflows/run_publish_site.yml @@ -29,7 +29,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v3 with: - ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }} + ref: ${{ inputs.checkout-ref || github.ref }} - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 870e9438..48319cad 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -1,9 +1,11 @@ name: Tests + on: workflow_dispatch: workflow_call: + concurrency: group: "Tests: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" cancel-in-progress: true diff --git a/.github/workflows/workflow_release.yml b/.github/workflows/workflow_release.yml index 04ddda47..6c52cdf2 100644 --- a/.github/workflows/workflow_release.yml +++ b/.github/workflows/workflow_release.yml @@ -37,7 +37,7 @@ jobs: contents: write packages: write with: - checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }} + checkout-ref: ${{ inputs.checkout-ref }} publish-site: needs: tests @@ -51,4 +51,4 @@ jobs: packages: write pages: write # to deploy to Pages with: - checkout-ref: ${{ inputs.checkout-ref || github.event.repository.default_branch }} + checkout-ref: ${{ inputs.checkout-ref }} From 711741bd8c6cd7a12c7279796b81a768eb431a61 Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:00:05 +0100 Subject: [PATCH 2/3] fix gradle wrapper --- .gitattributes | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index 296a416d..c80efdd8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ -# Common settings that generally should always be used with your language specific settings +# https://help.github.com/articles/dealing-with-line-endings/ +# https://github.com/alexkaratarakis/gitattributes -# Auto detect text files and perform LF normalization -* text eol=lf +* text=auto # The above will handle all files NOT found below @@ -44,12 +44,14 @@ *.cmd text eol=crlf *.ps1 text eol=crlf - -# JVM sources -*.java text diff=java -*.gradle text diff=java -*.kt text diff=java -*.kts text diff=java +# JVM +*.java text diff=java +*.gradle text diff=java +*.java text diff=java +*.kt text diff=kotlin +*.kts text diff=kotlin +*.properties text +*.jar binary # Text files where line endings should be preserved *.patch -text From e2b0de964f4a5a572ec0b307dc6fc138509dcedd Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:04:19 +0100 Subject: [PATCH 3/3] update gradle wrapper again?? --- gradle/wrapper/gradle-wrapper.jar | Bin 43461 -> 43462 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 933486d825af8377635acd7cb3fb7bb529199ae7..d64cd4917707c1f8861d8cb53dd15194d4248596 100644 GIT binary patch delta 16 YcmX?lnd#VNrVTgq8F@F~%ztAE07-BNTmS$7 delta 14 WcmX?hnd#_drVTgqH{Z&CV+jC0#t2UU