summaryrefslogtreecommitdiffstats
path: root/.github/workflows/regen.yml
blob: a2b4ef2b934bde18190caad3f59b0057d45418a2 (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
name: PR Regenerate Files

permissions:
  contents: read

on:
  pull_request:
    paths:
    - 'data/constants/**'
    - 'lib/python/**'

jobs:
  regen:
    runs-on: ubuntu-latest

    container: ghcr.io/qmk/qmk_cli

    steps:
    - name: Disable safe.directory check
      run : git config --global --add safe.directory '*'

    - uses: actions/checkout@v3

    - name: Run qmk generators
      run: |
        util/regen.sh
        git diff

    - name: Fail when regeneration required
      run: |
        git diff
        for file in $(git diff --name-only); do
          echo "File '${file}' Requires Regeneration"
          echo "::error file=${file}::Requires Regeneration"
        done
        test -z "$(git diff --name-only)"