-
Notifications
You must be signed in to change notification settings - Fork 10
41 lines (36 loc) · 1.19 KB
/
assess-file-changes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Assess file changes
on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
SOURCE_CHANGED:
description: "Whether or not the files under /src/ were changed."
value: ${{ jobs.build.outputs.SOURCE_CHANGED }}
jobs:
build:
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
SOURCE_CHANGED: ${{ steps.flagged-changes.outputs.SOURCE_CHANGED }}
name: Test changed-files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
- name: Assess Source Code Changes
id: flagged-changes
run: |
echo "::set-output name=SOURCE_CHANGED::false"
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo $file
if [[ $file == "src/nwbinspector/"* || $file == "requirements.txt" || $file == "setup.py" || $file == "tests/"* ]]
then
echo "Source changed"
echo "::set-output name=SOURCE_CHANGED::true"
else
echo "Source not changed"
fi
done