From 157ae0882719986606e20bbd0cdb05190a307429 Mon Sep 17 00:00:00 2001 From: Nils Heydecker <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:56:03 +0200 Subject: [PATCH] it's fine 2 --- .github/workflows/test.yml | 6 +++--- gen-service-version.js | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbaf1cb..cc9a051 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ name: testing out on: push: - branches: [ main ] + branches: [main] jobs: install-build: @@ -15,9 +15,9 @@ jobs: steps: - name: install id: install - run: | + run: | echo pnpm install - node ./gen-service-version.mjs + node ./gen-service-version.js foo-service: needs: [install-build] diff --git a/gen-service-version.js b/gen-service-version.js index ed90e93..8d032b7 100644 --- a/gen-service-version.js +++ b/gen-service-version.js @@ -1,24 +1,26 @@ -const child_process = require('child_process'); +const child_process = require("child_process"); -const services = ['bar-service', 'foo-service']; +const services = ["bar-service", "foo-service"]; function latestCommitInDirectory(dirname) { - return String(child_process.execSync(`git log --pretty=format:%H -n 1 -- ${dirname}`)); + return String( + child_process.execSync(`git log --pretty=format:%H -n 1 -- ${dirname}`) + ); } const serviceVersions = {}; -const currentCommit = latestCommitInDirectory('.'); +const currentCommit = latestCommitInDirectory("."); for (const service of services) { - serviceVersions[service] = latestCommitInDirectory(service); + serviceVersions[service] = latestCommitInDirectory(service); } console.log(currentCommit); console.log(serviceVersions); Object.entries(serviceVersions).forEach(([name, version]) => { - const skip = version === currentCommit ? 'run' : 'skip'; + const skip = version === currentCommit ? "run" : "skip"; - console.log(`::set-output name=${name}::${skip}`) + console.log(`::set-output name=${name}::${skip}`); });