add raw-output option for json output (#900)
Co-authored-by: Tonye Jack <jtonye@ymail.com> Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
30
.github/workflows/manual-matrix-test.yml
vendored
30
.github/workflows/manual-matrix-test.yml
vendored
@@ -12,6 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
matrix-raw-format: ${{ steps.set-matrix-json-raw-format.outputs.matrix }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -23,11 +24,19 @@ jobs:
|
||||
with:
|
||||
json: true
|
||||
- name: List all changed files
|
||||
run: |
|
||||
echo '${{ steps.changed-files.outputs.all_changed_files }}'
|
||||
|
||||
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
|
||||
- id: set-matrix
|
||||
run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
|
||||
- name: Get changed files json raw format
|
||||
id: changed-files-json-raw-format
|
||||
uses: ./
|
||||
with:
|
||||
json: true
|
||||
json_raw_format: true
|
||||
- name: List all changed files json raw format
|
||||
run: echo '${{ steps.changed-files-json-raw-format.outputs.all_changed_files }}'
|
||||
- id: set-matrix-json-raw-format
|
||||
run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
matrix-job:
|
||||
name: Run Matrix Job
|
||||
@@ -43,3 +52,18 @@ jobs:
|
||||
- name: Test
|
||||
run: |
|
||||
echo ${{ matrix.container }}
|
||||
|
||||
matrix-job-json-raw-format:
|
||||
name: Run Matrix Job json raw format
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changed-files]
|
||||
strategy:
|
||||
matrix: ${{ fromJSON(needs.changed-files.outputs.matrix-raw-format) }}
|
||||
max-parallel: 4
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Test
|
||||
run: |
|
||||
echo ${{ matrix.container }}
|
||||
|
||||
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -529,6 +529,18 @@ jobs:
|
||||
echo '${{ toJSON(steps.changed-files-json.outputs.all_changed_files) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with json raw format
|
||||
id: changed-files-json-raw-format
|
||||
uses: ./
|
||||
with:
|
||||
json: true
|
||||
json_raw_format: true
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-json-raw-format.outputs) }}'
|
||||
echo '${{ toJSON(steps.changed-files-json-raw-format.outputs.all_changed_files) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with comma separator
|
||||
id: changed-files-comma
|
||||
uses: ./
|
||||
|
||||
Reference in New Issue
Block a user