From 5b1fb84fabad3666a37f3790c8a012bcf9565bd3 Mon Sep 17 00:00:00 2001 From: Joel Dierkes Date: Mon, 13 Dec 2021 11:11:36 +0100 Subject: [PATCH] Add a header check to the CI Fix #4980 The `add_header` script needs to be run after an edit to determine the status of the header and, if necessary, change the header. This commit adds the check for the header to the CI/CD. This enforces the usage of the `add_header` script and ensures a healthy code base. --- .github/workflows/autotest.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index e3e4915c992..7039c1dc9cf 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -5,7 +5,22 @@ on: - push jobs: + add_header_test: + if: 'github.event_name == ''pull_request''' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: | + for file in $(find . -type f -name '*.py') + do + tools/add_header --disable-add-me -cd -- $file + done + tools/add_header --disable-add-me -cd -- bin/* setup: + if: ${{ success() || cancelled() }} + needs: add_header_test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2