aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/files-changed.yml
blob: e209be8e8d95987a39810e4d6a1187466bcb0bab (plain)
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
name: files-changed

on:
  workflow_call:
    outputs:
      backend:
        description: "whether backend files changed"
        value: ${{ jobs.detect.outputs.backend }}
      frontend:
        description: "whether frontend files changed"
        value: ${{ jobs.detect.outputs.frontend }}
      docs:
        description: "whether docs files changed"
        value: ${{ jobs.detect.outputs.docs }}
      actions:
        description: "whether actions files changed"
        value: ${{ jobs.detect.outputs.actions }}
      templates:
        description: "whether templates files changed"
        value: ${{ jobs.detect.outputs.templates }}

jobs:
  detect:
    name: detect which files changed
    runs-on: ubuntu-latest
    timeout-minutes: 3
    # Map a step output to a job output
    outputs:
      backend: ${{ steps.changes.outputs.backend }}
      frontend: ${{ steps.changes.outputs.frontend }}
      docs: ${{ steps.changes.outputs.docs }}
      actions: ${{ steps.changes.outputs.actions }}
      templates: ${{ steps.changes.outputs.templates }}
    steps:
      - uses: actions/checkout@v3
      - uses: dorny/paths-filter@v2
        id: changes
        with:
          filters: |
            backend:
              - "**/*.go"
              - "templates/**/*.tmpl"
              - "go.mod"
              - "go.sum"

            frontend:
              - "**/*.js"
              - "web_src/**"
              - "package.json"
              - "package-lock.json"

            docs:
              - "**/*.md"
              - "docs/**"

            actions:
              - ".github/workflows/*"

            templates:
              - "templates/**/*.tmpl"
              - "poetry.lock"