From bb5fddcfa678793fbb6769d927174ab3a1ffafd8 Mon Sep 17 00:00:00 2001 From: Nils Heydecker <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:52:58 +0200 Subject: [PATCH] magic! --- .github/workflows/test.yml | 4 ++-- gen-service-version.mjs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6676a8c..5d2da02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,8 +9,8 @@ on: jobs: install-build: outputs: - foo-service: 'run' - bar-service: 'skip' + foo-service: ${{ steps.install.outputs.foo-service }} + bar-service: ${{ steps.install.outputs.bar-service }} runs-on: ubuntu-latest steps: - name: install diff --git a/gen-service-version.mjs b/gen-service-version.mjs index a5aac18..533de69 100644 --- a/gen-service-version.mjs +++ b/gen-service-version.mjs @@ -11,10 +11,14 @@ const serviceVersions = {}; const currentCommit = latestCommitInDirectory('.'); for (const service of services) { - const version = latestCommitInDirectory(service); - - serviceVersions[service] = version; + serviceVersions[service] = latestCommitInDirectory(service); } console.log(currentCommit); console.log(serviceVersions); + +Object.entries(serviceVersions).forEach(([name, version]) => { + const skip = version === currentCommit ? 'run' : 'skip'; + + console.log(`::set-output name=${name}::${skip}`) +});