-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (69 loc) · 2.59 KB
/
workflow-check-for-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
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
name: "Check for file changes"
on:
workflow_call:
inputs:
infra_base_sha:
description: "Base SHA for infrastructure changes"
required: false
default: ''
type: string
apps_base_sha:
description: "Base SHA for application changes"
required: false
default: ''
type: string
outputs:
hasInfrastructureChanges:
description: "Infrastructure related files changed"
value: ${{ jobs.check-for-changes.outputs.hasInfrastructureChanges }}
hasApplicationChanges:
description: "Application related files changed"
value: ${{ jobs.check-for-changes.outputs.hasApplicationChanges }}
hasMigrationChanges:
description: "Migration related files changed"
value: ${{ jobs.check-for-changes.outputs.hasMigrationChanges }}
hasNodeLoggerChanges:
description: "Node Logger related files changed"
value: ${{ jobs.check-for-changes.outputs.hasNodeLoggerChanges }}
jobs:
check-for-changes:
name: Filter
runs-on: ubuntu-latest
outputs:
hasInfrastructureChanges: ${{ steps.filter-infra.outputs.infrastructure_any_modified == 'true' }}
hasApplicationChanges: ${{ steps.filter-apps.outputs.applications_any_modified == 'true' }}
hasMigrationChanges: ${{ steps.filter-apps.outputs.migrations_any_modified == 'true' }}
hasNodeLoggerChanges: ${{ steps.filter-apps.outputs.nodeLogger_any_modified == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# fetch-depth needs to be 0 in cases where we want to fetch changes since previous tag for example
fetch-depth: 0
- uses: tj-actions/changed-files@v42
id: filter-infra
with:
base_sha: ${{ inputs.infra_base_sha }}
files_yaml: |
infrastructure:
- '.github/**/*'
- '.azure/infrastructure/*'
- '.azure/modules/**/*'
- uses: tj-actions/changed-files@v42
id: filter-apps
with:
base_sha: ${{ inputs.apps_base_sha }}
files_yaml: |
applications:
- '.github/**/*'
- '.azure/applications/**/*'
- '.azure/modules/**/*'
- 'packages/bff/**/*'
- 'packages/frontend/**/*'
migrations:
- 'packages/bff/src/migrations/**/*'
- '.azure/applications/bff-migration-job/**/*'
- '.azure/modules/containerAppJob/**/*'
nodeLogger:
- '.github/**/*'
- 'packages/node-logger/**/*'