From 148bd43e74a634456e130690ece1e10bb2c21c81 Mon Sep 17 00:00:00 2001 From: Daniil Samoylov Date: Wed, 11 Sep 2024 18:04:36 +1200 Subject: [PATCH] Testing alternative set --- .github/workflows/pull-request-verification.yml | 4 ++-- dist/index.mjs | 5 ++++- src/main.ts | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-verification.yml b/.github/workflows/pull-request-verification.yml index 8b52384..e6896ca 100644 --- a/.github/workflows/pull-request-verification.yml +++ b/.github/workflows/pull-request-verification.yml @@ -150,9 +150,9 @@ jobs: run: exit 1 - name: added-test - if: steps.filter.outputs.local_added != 1 + if: ${{ !steps.filter.outputs.local_added }} run: exit 1 - name: modified-test - if: steps.filter.outputs.local_modified != 0 + if: ${{ steps.filter.outputs.local_modified }} run: exit 1 diff --git a/dist/index.mjs b/dist/index.mjs index 138515e..97764de 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -29682,7 +29682,10 @@ function exportResults(results, format) { core3.setOutput(key, value); core3.setOutput(`${key}_count`, files.length); for (const status of Object.values(ChangeStatus)) { - core3.setOutput(`${key}_${status.toLocaleLowerCase()}`, files.filter((x) => x.status === status).length); + const matches = files.some((x) => x.status === status); + if (matches) { + core3.setOutput(`${key}_${status.toLocaleLowerCase()}`, true); + } } if (format !== "none") { const filesValue = serializeExport(files, format); diff --git a/src/main.ts b/src/main.ts index ab7babc..3bf8901 100644 --- a/src/main.ts +++ b/src/main.ts @@ -244,7 +244,10 @@ function exportResults(results: FilterResults, format: ExportFormat): void { core.setOutput(`${key}_count`, files.length) for (const status of Object.values(ChangeStatus)) { - core.setOutput(`${key}_${status.toLocaleLowerCase()}`, files.filter(x => x.status === status).length) + const matches = files.some(x => x.status === status) + if (matches) { + core.setOutput(`${key}_${status.toLocaleLowerCase()}`, true) + } } if (format !== 'none') {