From 782be980da7ec02da92a5ed6231187b744d0d78c Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:11:38 +0200 Subject: [PATCH] list-targets: check targets are set Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/ci-subaction.yml | 36 ++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-subaction.yml b/.github/workflows/ci-subaction.yml index b36990f..cb84fc6 100644 --- a/.github/workflows/ci-subaction.yml +++ b/.github/workflows/ci-subaction.yml @@ -38,9 +38,15 @@ jobs: with: workdir: ./test/group - - name: Show targets - run: | - echo targets=${{ steps.gen.outputs.targets }} + name: Check targets + uses: actions/github-script@v7 + with: + script: | + const targets = `${{ steps.gen.outputs.targets }}`; + if (!targets) { + core.setFailed('No targets generated'); + } + core.info(`targets=${targets}`); list-targets-group-matrix: runs-on: ubuntu-latest @@ -56,9 +62,15 @@ jobs: workdir: ./test/group-matrix target: validate - - name: Show targets - run: | - echo targets=${{ steps.gen.outputs.targets }} + name: Check targets + uses: actions/github-script@v7 + with: + script: | + const targets = `${{ steps.gen.outputs.targets }}`; + if (!targets) { + core.setFailed('No targets generated'); + } + core.info(`targets=${targets}`); list-targets-multi-files: runs-on: ubuntu-latest @@ -76,6 +88,12 @@ jobs: docker-bake.json docker-bake.hcl - - name: Show targets - run: | - echo targets=${{ steps.gen.outputs.targets }} + name: Check targets + uses: actions/github-script@v7 + with: + script: | + const targets = `${{ steps.gen.outputs.targets }}`; + if (!targets) { + core.setFailed('No targets generated'); + } + core.info(`targets=${targets}`);