From cd1e4bc7581151280dfe158a0a6b5ad489e3b544 Mon Sep 17 00:00:00 2001 From: "Marcelo E. Magallon" Date: Tue, 14 May 2024 11:27:15 -0600 Subject: [PATCH] Add Github action to validate generated files This is a quick Github action that tries to generate files when their sources change and fails if the corresponding generated files are not updated. Signed-off-by: Marcelo E. Magallon --- .github/workflows/bad-pr.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/bad-pr.yml diff --git a/.github/workflows/bad-pr.yml b/.github/workflows/bad-pr.yml new file mode 100644 index 0000000..69278a1 --- /dev/null +++ b/.github/workflows/bad-pr.yml @@ -0,0 +1,25 @@ +name: "Verify generated files" + +on: + pull_request: + branches: + - main + paths: + - versions.yaml + - Dockerfile.tmpl + + workflow_dispatch: + +jobs: + validate: + name: Validate pull request + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Verify generated files + run: | + # Generate Dockerfile + make Dockerfile + # Check if the generated Dockerfile is different from the one in the repository + git diff --no-ext-diff --quiet