-
Notifications
You must be signed in to change notification settings - Fork 44
83 lines (82 loc) · 3.29 KB
/
hasChanged.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Check if files or folders have been changed
on:
workflow_call:
outputs:
outputAffected:
description: "Boolean value indicating changes in any file or folder that has an effect on the output"
value: ${{ jobs.hasChanged.outputs.src || jobs.hasChanged.outputs.buildScripts }}
tokens:
description: "Boolean value indicating change in src/tokens folder"
value: ${{ jobs.hasChanged.outputs.tokens }}
src:
description: "Boolean value indicating change in src folder"
value: ${{ jobs.hasChanged.outputs.src }}
buildConfig:
description: "Boolean value indicating changes of the build configuration in src folder"
value: ${{ jobs.hasChanged.outputs.buildConfig }}
scripts:
description: "Boolean value indicating change in scripts folder"
value: ${{ jobs.hasChanged.outputs.scripts }}
buildScripts:
description: "Boolean value indicating change in build files in the build folder"
value: ${{ jobs.hasChanged.outputs.buildScripts }}
dependencies:
description: "Boolean value indicating change in dependencies"
value: ${{ jobs.hasChanged.outputs.dependencies }}
docs:
description: "Boolean value indicating change in docs folder"
value: ${{ jobs.hasChanged.outputs.docs }}
jobs:
hasChanged:
name: Checking for changes
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
outputAffected: ${{ steps.filter.outputs.outputAffected }}
tokens: ${{ steps.filter.outputs.tokens }}
src: ${{ steps.filter.outputs.src }}
buildConfig: ${{ steps.filter.outputs.buildConfig }}
scripts: ${{ steps.filter.outputs.scripts }}
buildScripts: ${{ steps.filter.outputs.buildScripts }}
dependencies: ${{ steps.filter.outputs.dependencies }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
tokens:
- 'src/tokens/**'
- 'scripts/color-contrast.config.ts'
src:
- 'src/**/**.ts'
- 'src/**/**.json'
- 'src/**/**.json5'
buildConfig:
- 'src/**/**.ts'
scripts:
- 'scripts/**'
buildScripts:
- 'scripts/buildTokens.ts'
- 'scripts/themes.config.ts'
- 'tsconfig.json'
- 'package.json'
dependencies:
- 'package.json'
- 'package-lock.json'
docs:
- 'docs/**'
- name: Detecting changes that effect output
if: steps.filter.outputs.tokens == 'true' || steps.filter.outputs.src == 'true' || steps.filter.outputs.scripts == 'true' || steps.filter.outputs.dependencies == 'true' || steps.filter.outputs.docs == 'true'
run: |
echo Changes detected
echo - tokens: ${{ steps.filter.outputs.tokens }}
echo - src: ${{ steps.filter.outputs.src }}
echo - scripts: ${{ steps.filter.outputs.scripts }}
echo - buildScripts: ${{ steps.filter.outputs.buildScripts }}
echo - dependencies: ${{ steps.filter.outputs.dependencies }}
echo - docs: ${{ steps.filter.outputs.docs }}