From b05c075b43d7e16d5d63cdbaeebfc8aad37d00c5 Mon Sep 17 00:00:00 2001 From: rnsc Date: Tue, 13 Jul 2021 18:37:34 +0200 Subject: [PATCH] fix the README --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3dfbc16..1c1c858 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ See [action.yml](action.yml) # Can be 'space-delimited', 'csv', or 'json'. # Default: 'space-delimited' format: '' - # Filter files using a regex + # Filter files using a glob filter filter: '*' ``` @@ -34,6 +34,7 @@ See [action.yml](action.yml) - [Usage](#usage) - [Scenarios](#scenarios) - [Get all changed files as space-delimited](#get-all-changed-files-as-space-delimited) + - [Get all changed *.php files as space-delimited](#get-all-changed-php-files-as-space-delimited) - [Get all changed *.yml files but exclude .github/*/*.yml files](#get-all-changed-yml-files-but-exclude-githubyml-files) - [Get all added and modified files as CSV](#get-all-added-and-modified-files-as-csv) - [Get all removed files as JSON](#get-all-removed-files-as-json) @@ -45,6 +46,20 @@ See [action.yml](action.yml) If there are any files with spaces in them, then this method won't work and the step will fail. Consider using one of the other formats if that's the case. +```yaml +- id: files + uses: Ana06/get-changed-files@v2.0.0 +- run: | + for changed_file in ${{ steps.files.outputs.all }}; do + echo "Do something with this ${changed_file}." + done +``` + +### Get all changed *.php files as space-delimited + +If there are any files with spaces in them, then this method won't work and the step will fail. +Consider using one of the other formats if that's the case. + ```yaml - id: files uses: Ana06/get-changed-files@v2.0.0 @@ -65,11 +80,6 @@ If those two globs were inverted, you **would** include all the YML files, with ```yaml - uses: Ana06/get-changed-files@v2.0.0 with: - # Format of the steps output context. - # Can be 'space-delimited', 'csv', or 'json'. - # Default: 'space-delimited' - format: '' - # Filter files using a regex filter: | *.yml !.github/*/*.yml