Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Dec 23, 2023
1 parent 1864078 commit bb89f97
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,13 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
safe_output: false # true by default, set to false because we are using an environment variable to store the output and avoid command injection.

# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
# since_last_remote_commit: true

- name: List all changed files
env:
ALL_CHANGED_FILES: |-
${{ steps.changed-files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
Expand All @@ -144,16 +140,14 @@ jobs:
id: changed-markdown-files
uses: tj-actions/changed-files@v40
with:
safe_output: false # true by default, set to false because we are using an environment variable to store the output and avoid command injection.
# Avoid using single or double quotes for multiline patterns
files: |
**.md
- name: List all changed files markdown files
if: steps.changed-markdown-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: |-
${{ steps.changed-markdown-files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
run: |
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
Expand All @@ -164,7 +158,6 @@ jobs:
id: changed-files-yaml
uses: tj-actions/changed-files@v40
with:
safe_output: false # true by default, set to false because we are using an environment variable to store the output and avoid command injection.
files_yaml: |
doc:
- '**.md'
Expand All @@ -181,17 +174,15 @@ jobs:
# NOTE: Ensure all outputs are prefixed by the same key used above e.g. `test_(...)` | `doc_(...)` | `src_(...)` when trying to access the `any_changed` output.
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
env:
TEST_ALL_CHANGED_FILES: |-
${{ steps.changed-files-yaml.outputs.test_all_changed_files }}
TEST_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.test_all_changed_files }}
run: |
echo "One or more test file(s) has changed."
echo "List all the files that have changed: $TEST_ALL_CHANGED_FILES"
- name: Run step if doc file(s) change
if: steps.changed-files-yaml.outputs.doc_any_changed == 'true'
env:
DOC_ALL_CHANGED_FILES: |-
${{ steps.changed-files-yaml.outputs.doc_all_changed_files }}
DOC_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.doc_all_changed_files }}
run: |
echo "One or more doc file(s) has changed."
echo "List all the files that have changed: $DOC_ALL_CHANGED_FILES"
Expand All @@ -201,15 +192,13 @@ jobs:
id: changed-files-specific
uses: tj-actions/changed-files@v40
with:
safe_output: false # true by default, set to false because we are using an environment variable to store the output and avoid command injection.
files: docs/*.{js,html} # Alternatively using: `docs/**`
files_ignore: docs/static.js

- name: Run step if any file(s) in the docs folder change
if: steps.changed-files-specific.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: |-
${{ steps.changed-files-specific.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-files-specific.outputs.all_changed_files }}
run: |
echo "One or more files in the docs folder has changed."
echo "List all the files that have changed: $ALL_CHANGED_FILES"
Expand Down

0 comments on commit bb89f97

Please sign in to comment.