mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-29 19:39:37 +09:00
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Check Generated Files
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: nix develop --fallback --command bash -e {0}
|
|
|
|
jobs:
|
|
check-generated:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 2
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
|
|
with:
|
|
filters: |
|
|
files:
|
|
- '*.nix'
|
|
- 'go.*'
|
|
- '**/*.go'
|
|
- 'flake.lock'
|
|
- 'tools/**'
|
|
- 'Makefile'
|
|
- uses: NixOS/nix-installer-action@62c1943b776c509394b550f3f983adc14e9212d6 # main
|
|
if: steps.changed-files.outputs.files == 'true'
|
|
- uses: Mic92/hestia@dfed9ced335d28978ba74e513939a10db1f71025 # v3.1.0
|
|
if: steps.changed-files.outputs.files == 'true'
|
|
|
|
- name: Run make generate
|
|
if: steps.changed-files.outputs.files == 'true'
|
|
run: make generate
|
|
|
|
- name: Check for uncommitted changes
|
|
if: steps.changed-files.outputs.files == 'true'
|
|
run: |
|
|
if ! git diff --exit-code; then
|
|
echo "❌ Generated files are not up to date!"
|
|
echo "Please run 'make generate' and commit the changes."
|
|
exit 1
|
|
else
|
|
echo "✅ All generated files are up to date."
|
|
fi
|