This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
63 lines (57 loc) · 2.4 KB
/
_filechange_checker.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Filechange Checker
on:
workflow_call:
outputs:
srcfileschanged:
description: "'true' if src/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.srcfileschanged }}
websitefileschanged:
description: "'true' if websites/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.websitefileschanged }}
actionsfileschanged:
description: "'true' if .github/actions/** or .github/workflows/** files have changed in the branch"
value: ${{ jobs.file-change-check.outputs.actionsfileschanged }}
jobs:
file-change-check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
srcfileschanged: ${{ steps.srcchecker.outputs.srcfileschanged }}
websitefileschanged: ${{ steps.websitechecker.outputs.websitefileschanged }}
actionsfileschanged: ${{ steps.actionschecker.outputs.actionsfileschanged }}
steps:
- uses: actions/checkout@v4
# only run CI tests if the src folder or workflow actions have changed
- name: Check for file changes in src/ or .github/workflows/
uses: dorny/paths-filter@v3
id: dornycheck
with:
list-files: json
filters: |
src:
- 'src/**'
website:
- 'website/**'
actions:
- '.github/workflows/**'
- '.github/actions/**'
- name: Check dorny for changes in src filepaths
id: srcchecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "src or workflow file changes occurred"
echo srcfileschanged=true >> $GITHUB_OUTPUT
- name: Check dorny for changes in website related filepaths
id: websitechecker
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.website == 'true' || steps.dornycheck.outputs.actions == 'true'
run: |
echo "website or workflow file changes occurred"
echo websitefileschanged=true >> $GITHUB_OUTPUT
- name: Check dorny for changes in actions filepaths
id: actionschecker
if: steps.dornycheck.outputs.actions == 'true'
run: |
echo "actions file changes occurred"
echo actionsfileschanged=true >> $GITHUB_OUTPUT