diff --git a/.github/workflows/netcetera-publish.yml b/.github/workflows/netcetera-publish.yml index 96fba51b..bd3b3f71 100644 --- a/.github/workflows/netcetera-publish.yml +++ b/.github/workflows/netcetera-publish.yml @@ -21,6 +21,8 @@ jobs: - name: Build run: ./gradlew :netcetera-3ds-core:assembleProductionRelease + env: + NETCETERA_API_KEY: ${{ secrets.NETCETERA_API_KEY }} - name: Publish To Maven Central run: ./gradlew :netcetera-3ds-core:publishProductionReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository --max-workers=1 diff --git a/.github/workflows/netcetera-update.yml b/.github/workflows/netcetera-update.yml index 0ed68b03..8e5fcfbd 100644 --- a/.github/workflows/netcetera-update.yml +++ b/.github/workflows/netcetera-update.yml @@ -40,6 +40,8 @@ jobs: - name: Build Verification run: ./gradlew :netcetera-3ds-core:assembleProductionRelease + env: + NETCETERA_API_KEY: ${{ secrets.NETCETERA_API_KEY }} - name: Create Pull Request uses: peter-evans/create-pull-request@v5.0.0 diff --git a/netcetera-3ds-core/build.gradle b/netcetera-3ds-core/build.gradle index b8a9a1a6..e536b767 100644 --- a/netcetera-3ds-core/build.gradle +++ b/netcetera-3ds-core/build.gradle @@ -103,8 +103,13 @@ def getApiKey() { throw new GradleException("Missing or blank 'netcetera.apiKey' in 'local.properties' file.") } return apiKey + } else { + String apiKey = System.getenv('NETCETERA_API_KEY') + if (!apiKey) { + throw new GradleException("Environment variable 'NETCETERA_API_KEY' is missing or blank.") + } + return apiKey } - throw new GradleException("File not found: 'local.properties'.") } tasks.register('afterKeepSecrets') {