feat: add support for json formatted output. (#557)
This commit is contained in:
39
.github/workflows/manual-matrix-test.yml
vendored
Normal file
39
.github/workflows/manual-matrix-test.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Manual Matrix Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
changed-files:
|
||||
name: Get changes
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: "{\"container\": ${{ toJson(steps.changed-files.outputs.all_changed_files) }} }"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # needed for tj-actions/changed-files
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v23
|
||||
with:
|
||||
json: true
|
||||
- name: List all changed files
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files.outputs.all_changed_files) }}'
|
||||
|
||||
matrix-job:
|
||||
name: Run Matrix Job
|
||||
runs-on: ubuntu-latest
|
||||
needs: [changed-files]
|
||||
strategy:
|
||||
matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
|
||||
max-parallel: 4
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Test
|
||||
run: |
|
||||
echo ${{ matrix.container }}
|
||||
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@@ -332,6 +332,17 @@ jobs:
|
||||
echo '${{ toJSON(steps.changed-files-pipe.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with json output
|
||||
id: changed-files-json
|
||||
uses: ./
|
||||
with:
|
||||
json: true
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-json.outputs) }}'
|
||||
echo '${{ toJSON(steps.changed-files-json.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