From d5e6399d987143a14c9d423d117eb4e779bc83e6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 1 Mar 2023 08:51:28 +0100 Subject: [PATCH] ci: Add validation for Copyright headers Strictly enforce up-to-date copyright headers using CI/CD. --- .github/workflows/validate.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..aa66d308 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,35 @@ +# AUTOGENERATED COPYRIGHT HEADER START +# Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks +# AUTOGENERATED COPYRIGHT HEADER END + +name: Validate Pull Request + +on: + pull_request: + branches: + - '*' + +concurrency: + group: validate-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + validate: + name: "Pull Request Validation" + strategy: + fail-fast: true + runs-on: "ubuntu-22.04" + steps: + - name: "Clone" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 + + - name: "Copyright Headers" + shell: bash + run: | + node "tools/copyright.js" . + git --no-pager diff --patch --minimal HEAD -- + git update-index --refresh + git diff-index --quiet HEAD --