-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added action to detect changed files
- Loading branch information
1 parent
9cde769
commit afa452c
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Changed files | ||
|
||
on: | ||
merge: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
changed_files: | ||
runs-on: ubuntu-latest # windows-latest || macos-latest | ||
name: Changed files | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get all test, doc and src files that have changed | ||
id: changed-files-yaml | ||
uses: tj-actions/changed-files@v38 | ||
with: | ||
files_yaml: | | ||
matlab: | ||
- '**/*.m' | ||
- '!/external/**.m' | ||
- '!/test/**.m' | ||
- name: Run step if test file(s) change | ||
if: steps.changed-files-yaml.outputs.test_any_changed == 'true' | ||
run: | | ||
echo "Thes files have changed: ${{ steps.changed-files-yaml.outputs.matlab_all_changed_files }}" | ||
- name: List all changed files | ||
if: steps.changed-files-yaml.outputs.test_any_changed == 'true' | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.matlab_all_changed_files }}; do | ||
echo "$file was changed" | ||
done | ||