From 05bdc91228c589841621aee130aa6033579687de Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 19 Nov 2023 20:05:34 -0700 Subject: [PATCH] chore: simplify matrix example workflow (#1719) Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> --- .github/workflows/matrix-test.yml | 10 +++++----- action.yml | 4 ++-- src/__tests__/main.test.ts | 5 ----- 3 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 src/__tests__/main.test.ts diff --git a/.github/workflows/matrix-test.yml b/.github/workflows/matrix-test.yml index ab3016d6..c4978ebd 100644 --- a/.github/workflows/matrix-test.yml +++ b/.github/workflows/matrix-test.yml @@ -8,10 +8,10 @@ on: jobs: changed-files: - name: Get changes + name: Get changed files runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + matrix: ${{ steps.changed-files.outputs.all_changed_files }} steps: - name: Checkout uses: actions/checkout@v4 @@ -23,17 +23,17 @@ jobs: with: json: true quotepath: false + escape_json: false - name: List all changed files run: echo '${{ steps.changed-files.outputs.all_changed_files }}' - - id: set-matrix - run: echo "matrix={\"files\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" matrix-job: name: Run Matrix Job runs-on: ubuntu-latest needs: [changed-files] strategy: - matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }} + matrix: + files: ${{ fromJSON(needs.changed-files.outputs.matrix) }} max-parallel: 4 fail-fast: false steps: diff --git a/action.yml b/action.yml index e093f825..ecb67810 100644 --- a/action.yml +++ b/action.yml @@ -4,7 +4,7 @@ author: tj-actions inputs: separator: - description: "Split character for output strings" + description: "Split character for output strings." required: false default: " " include_all_old_new_renamed_files: @@ -24,7 +24,7 @@ inputs: required: false default: "" files_from_source_file_separator: - description: 'Separator used to split the `files_from_source_file` input' + description: "Separator used to split the `files_from_source_file` input." default: "\n" required: false files: diff --git a/src/__tests__/main.test.ts b/src/__tests__/main.test.ts deleted file mode 100644 index 0340b61d..00000000 --- a/src/__tests__/main.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('main test', () => { - it('adds two numbers', async () => { - expect(1 + 1).toEqual(2) - }) -})