From f1cec87842412e5509e64313cc3a053f90c67fac Mon Sep 17 00:00:00 2001 From: Piotr Krzeminski Date: Wed, 18 Sep 2024 08:39:04 +0200 Subject: [PATCH] Fix metadata updating by using required Java version --- .github/workflows/update-metadata.main.kts | 6 ++++++ .github/workflows/update-metadata.yaml | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-metadata.main.kts b/.github/workflows/update-metadata.main.kts index 9c281a1..65fed74 100755 --- a/.github/workflows/update-metadata.main.kts +++ b/.github/workflows/update-metadata.main.kts @@ -6,8 +6,10 @@ @file:Repository("https://bindings.krzeminski.it") @file:DependsOn("actions:checkout:v4") +@file:DependsOn("actions:setup-java:v4") import io.github.typesafegithub.workflows.actions.actions.Checkout +import io.github.typesafegithub.workflows.actions.actions.SetupJava import io.github.typesafegithub.workflows.annotations.ExperimentalKotlinLogicStep import io.github.typesafegithub.workflows.domain.RunnerType import io.github.typesafegithub.workflows.dsl.workflow @@ -28,6 +30,10 @@ workflow( runsOn = RunnerType.UbuntuLatest, ) { uses(action = Checkout()) + uses(action = SetupJava( + distribution = SetupJava.Distribution.Zulu, + javaVersion = "17", + )) run( name = "Configure git", command = """ diff --git a/.github/workflows/update-metadata.yaml b/.github/workflows/update-metadata.yaml index b6f6d1a..4798ad1 100644 --- a/.github/workflows/update-metadata.yaml +++ b/.github/workflows/update-metadata.yaml @@ -29,15 +29,20 @@ jobs: - id: 'step-0' uses: 'actions/checkout@v4' - id: 'step-1' + uses: 'actions/setup-java@v4' + with: + java-version: '17' + distribution: 'zulu' + - id: 'step-2' name: 'Configure git' run: |- git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]" - - id: 'step-2' + - id: 'step-3' name: 'Run generation logic' env: GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}' - run: 'GHWKT_RUN_STEP=''generate:step-2'' ''.github/workflows/update-metadata.main.kts''' - - id: 'step-3' + run: 'GHWKT_RUN_STEP=''generate:step-3'' ''.github/workflows/update-metadata.main.kts''' + - id: 'step-4' name: 'Push new commit' run: 'git push'