File tree Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 64
64
".github/workflows/eamxx-sa-testing.yml"
65
65
)
66
66
pattern=$(IFS=\|; echo "${paths[*]}")
67
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
68
- if [[ $changed_files =~ ^($pattern) ]]; then
67
+
68
+ # Use the GitHub API to get the list of changed files
69
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
70
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
71
+
72
+ # Extract the filenames from the response
73
+ changed_files=$(echo "$response" | jq -r '.[].filename')
74
+
75
+ if echo "$changed_files" | grep -qE "^($pattern)"; then
69
76
echo "value=true" >> $GITHUB_OUTPUT
70
77
else
71
78
echo "value=false" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 31
31
run : |
32
32
# For non-pull_request events, no need to check files
33
33
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
34
- # If not a PR event, set value to true and exit early
35
34
echo "value=true" >> $GITHUB_OUTPUT
36
35
exit 0 # Early exit
37
36
fi
45
44
)
46
45
47
46
pattern=$(IFS=\|; echo "${paths[*]}")
48
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
49
- if [[ $changed_files =~ ^($pattern) ]]; then
47
+
48
+ # Use the GitHub API to get the list of changed files
49
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
50
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
51
+
52
+ # Extract the filenames from the response
53
+ changed_files=$(echo "$response" | jq -r '.[].filename')
54
+
55
+ if echo "$changed_files" | grep -qE "^($pattern)"; then
50
56
echo "value=true" >> $GITHUB_OUTPUT
51
57
else
52
58
echo "value=false" >> $GITHUB_OUTPUT
80
86
./scripts/scripts-tests -f -m ghci-snl-cpu
81
87
./scripts/cime-nml-tests
82
88
fi
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
Original file line number Diff line number Diff line change 39
39
run : |
40
40
# For non-pull_request events, no need to check files
41
41
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
42
- # If not a PR event, set value to true and exit early
43
42
echo "value=true" >> $GITHUB_OUTPUT
44
43
exit 0 # Early exit
45
44
fi
56
55
"externals/YAKL"
57
56
".github/workflows/eamxx-v1-testing.yml"
58
57
)
58
+
59
59
pattern=$(IFS=\|; echo "${paths[*]}")
60
- changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
61
- if [[ $changed_files =~ ^($pattern) ]]; then
60
+
61
+ # Use the GitHub API to get the list of changed files
62
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
63
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
64
+
65
+ # Extract the filenames from the response
66
+ changed_files=$(echo "$response" | jq -r '.[].filename')
67
+
68
+ if echo "$changed_files" | grep -qE "^($pattern)"; then
62
69
echo "value=true" >> $GITHUB_OUTPUT
63
70
else
64
71
echo "value=false" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments