name: CI on: push: branches: - main pull_request: branches: - main jobs: test: runs-on: ubuntu-latest name: Test changed-files steps: - name: Checkout uses: actions/checkout@v2 - name: Run changed-files with defaults if: github.event_name == 'pull_request' id: changed-files uses: ./ - name: Show output if: github.event_name == 'pull_request' run: | echo "${{ toJSON(steps.changed-files.outputs) }}" - name: List all modified files if: github.event_name == 'pull_request' run: | for file in "${{ steps.changed-files.outputs.modified_files }}"; do echo $file done - name: Run step when README.md changes if: contains(fromJSON("${{ steps.changed-files.outputs.modified_files }}"), 'README.md') run: | echo "Your README.md has been modified." - name: Run changed-files with comma separator if: github.event_name == 'pull_request' id: changed-files-comma uses: ./ with: separator: "," - name: Show output if: github.event_name == 'pull_request' run: | echo "${{ toJSON(steps.changed-files-comma.outputs) }}"