-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (77 loc) · 2.89 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
74
75
76
77
78
79
80
81
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:
hasInfraChanges:
description: "Infrastructure related files changed"
value: ${{ jobs.check-for-changes.outputs.hasInfraChanges }}
hasBackendChanges:
description: "Backend related files changed"
value: ${{ jobs.check-for-changes.outputs.hasBackendChanges }}
hasTestChanges:
description: "Test related files changed"
value: ${{ jobs.check-for-changes.outputs.hasTestChanges }}
hasSlackNotifierChanges:
description: "Slack Notifier function related files changed"
value: ${{ jobs.check-for-changes.outputs.hasSlackNotifierChanges }}
hasSchemaChanges:
description: "Schema has changed"
value: ${{ jobs.check-for-changes.outputs.hasSchemaChanges }}
hasMigrationChanges:
description: "Migration related files changed"
value: ${{ jobs.check-for-changes.outputs.hasMigrationChanges }}
jobs:
check-for-changes:
name: Filter
runs-on: ubuntu-latest
outputs:
hasInfraChanges: ${{ steps.filter.outputs.azure_any_modified == 'true' }}
hasSlackNotifierChanges: ${{ steps.filter.outputs.slackNotifier_any_modified == 'true'}}
hasBackendChanges: ${{ steps.filter-backend.outputs.backend_any_modified == 'true' }}
hasTestChanges: ${{ steps.filter-backend.outputs.tests_any_modified == 'true' }}
hasSchemaChanges: ${{ steps.filter-backend.outputs.schema_any_modified == 'true'}}
hasMigrationChanges: ${{ steps.filter-backend.outputs.migration_any_modified == 'true'}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v45
id: filter
with:
base_sha: ${{ inputs.infra_base_sha }}
files_yaml: |
azure:
- '.github/**/*'
- '.azure/infrastructure/**/*'
- '.azure/modules/**/*'
slackNotifier:
- '.github/**/*'
- 'src/Digdir.Tool.Dialogporten.SlackNotifier/**/*'
- uses: tj-actions/changed-files@v45
id: filter-backend
with:
base_sha: ${{ inputs.apps_base_sha }}
files_yaml: |
backend:
- '.github/**/*'
- 'src/**/*'
- '.azure/applications/**/*'
- '.azure/modules/containerApp/**/*'
tests:
- 'tests/**/*'
schema:
- 'docs/schema/V1/**/*'
migration:
- 'src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/**/*'