From 4d930739423e553d9fc3985b2090a8d2e01ed8d0 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Sat, 16 Nov 2024 13:57:34 +0100 Subject: [PATCH] feat(gradle): support private submodules --- .github/workflows/gradle-library-check.yml | 5 +++++ .github/workflows/gradle-library-publish.yml | 5 +++++ .github/workflows/gradle-library.yml | 2 ++ .github/workflows/gradle-service-check.yml | 5 +++++ .github/workflows/gradle-service-publish.yml | 5 +++++ .github/workflows/gradle-service.yml | 2 ++ 6 files changed, 24 insertions(+) diff --git a/.github/workflows/gradle-library-check.yml b/.github/workflows/gradle-library-check.yml index 00e17ad..fc9394a 100644 --- a/.github/workflows/gradle-library-check.yml +++ b/.github/workflows/gradle-library-check.yml @@ -18,6 +18,10 @@ on: description: If JUnit test results are expected default: true type: boolean + submodules: + # see https://github.com/actions/checkout + default: 'false' + type: string checkout-ref: description: Custom ref to check out type: string @@ -46,6 +50,7 @@ jobs: java-version: ${{ inputs.java-version }} multi-module: ${{ inputs.multi-module }} expect-tests: ${{ inputs.expect-tests }} + submodules: ${{ inputs.submodules }} checkout-ref: ${{ inputs.checkout-ref }} skip-scan: ${{ inputs.skip-scan }} upload-artifact-path: ${{ inputs.upload-artifact-path }} diff --git a/.github/workflows/gradle-library-publish.yml b/.github/workflows/gradle-library-publish.yml index 9e06d94..f95356c 100644 --- a/.github/workflows/gradle-library-publish.yml +++ b/.github/workflows/gradle-library-publish.yml @@ -23,6 +23,10 @@ on: description: If JUnit test results are expected default: true type: boolean + submodules: + # see https://github.com/actions/checkout + default: 'false' + type: string checkout-ref: description: Custom ref to check out type: string @@ -70,6 +74,7 @@ jobs: java-version: ${{ inputs.java-version }} multi-module: ${{ inputs.multi-module }} expect-tests: ${{ inputs.expect-tests }} + submodules: ${{ inputs.submodules }} checkout-ref: ${{ inputs.checkout-ref }} skip-scan: ${{ inputs.skip-scan }} upload-artifact-path: ${{ inputs.upload-artifact-path }} diff --git a/.github/workflows/gradle-library.yml b/.github/workflows/gradle-library.yml index 36c6d10..eead2f9 100644 --- a/.github/workflows/gradle-library.yml +++ b/.github/workflows/gradle-library.yml @@ -108,6 +108,8 @@ jobs: persist-credentials: false # fetch-depth 0 is required to fetch all tags (and to determine the version based on tags) fetch-depth: ${{ inputs.publish-tasks != '' && '0' || '1' }} + # provide a token in case submodules are enabled and private (secret is expected to be present) + token: ${{ inputs.submodules != 'false' && secrets.GH_PAT || github.token }} # # Login to Docker Hub diff --git a/.github/workflows/gradle-service-check.yml b/.github/workflows/gradle-service-check.yml index a8fb984..a0df294 100644 --- a/.github/workflows/gradle-service-check.yml +++ b/.github/workflows/gradle-service-check.yml @@ -30,6 +30,10 @@ on: description: If JUnit test results are expected default: true type: boolean + submodules: + # see https://github.com/actions/checkout + default: 'false' + type: string checkout-ref: description: Custom ref to check out type: string @@ -55,6 +59,7 @@ jobs: image-tag-3: ${{ inputs.image-tag-3 }} multi-module: ${{ inputs.multi-module }} expect-tests: ${{ inputs.expect-tests }} + submodules: ${{ inputs.submodules }} checkout-ref: ${{ inputs.checkout-ref }} notify-failure: false secrets: inherit diff --git a/.github/workflows/gradle-service-publish.yml b/.github/workflows/gradle-service-publish.yml index 226c6aa..5271383 100644 --- a/.github/workflows/gradle-service-publish.yml +++ b/.github/workflows/gradle-service-publish.yml @@ -35,6 +35,10 @@ on: description: If JUnit test results are expected default: true type: boolean + submodules: + # see https://github.com/actions/checkout + default: 'false' + type: string checkout-ref: description: Custom ref to check out type: string @@ -73,6 +77,7 @@ jobs: image-tag-3: ${{ inputs.image-tag-3 }} multi-module: ${{ inputs.multi-module }} expect-tests: ${{ inputs.expect-tests }} + submodules: ${{ inputs.submodules }} checkout-ref: ${{ inputs.checkout-ref }} semantic-release: ${{ inputs.semantic-release }} semantic-release-dryrun: ${{ inputs.semantic-release-dryrun }} diff --git a/.github/workflows/gradle-service.yml b/.github/workflows/gradle-service.yml index c4e5554..6d78ee4 100644 --- a/.github/workflows/gradle-service.yml +++ b/.github/workflows/gradle-service.yml @@ -104,6 +104,8 @@ jobs: persist-credentials: false # fetch-depth 0 is required to fetch all tags (and to determine the version based on tags) fetch-depth: ${{ inputs.publish-tasks != '' && '0' || '1' }} + # provide a token in case submodules are enabled and private (secret is expected to be present) + token: ${{ inputs.submodules != 'false' && secrets.GH_PAT || github.token }} # For each environment variable's key-value pair, mask the value from logs. - name: Populate custom environment variables