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}`) +});