From fa1f64a2621dc6f8a9824d2b7b1a486595c00bbf Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Sun, 2 Mar 2025 17:26:33 +0100 Subject: [PATCH 1/2] Create check-restricted-files.yaml Simple workflow to check for changes to files in schemas and versions folder --- .github/workflows/check-restricted-files.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/check-restricted-files.yaml diff --git a/.github/workflows/check-restricted-files.yaml b/.github/workflows/check-restricted-files.yaml new file mode 100644 index 0000000000..8dab26a634 --- /dev/null +++ b/.github/workflows/check-restricted-files.yaml @@ -0,0 +1,30 @@ +name: check-restricted-files + +# Autor: @ralfhandl +# Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432 + +# This workflow checks for changes of restricted files in a pull request + +on: + - pull_request + +jobs: + check-files: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check changed files + shell: bash + run: | + set +e + + git diff --exit-code --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} \ + -- schemas versions + if [[ $? -ne 0 ]]; then + echo This PR contains changes to files that should not be changed on ${{ github.event.pull_request.base.ref }} + exit 1 + fi From fd06676459235f2cb245576a335a1df6eded7e2d Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 4 Mar 2025 18:41:53 +0100 Subject: [PATCH 2/2] Update check-restricted-files.yaml Co-authored-by: Lorna Jane Mitchell --- .github/workflows/check-restricted-files.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-restricted-files.yaml b/.github/workflows/check-restricted-files.yaml index 8dab26a634..8af8a035af 100644 --- a/.github/workflows/check-restricted-files.yaml +++ b/.github/workflows/check-restricted-files.yaml @@ -1,6 +1,6 @@ name: check-restricted-files -# Autor: @ralfhandl +# Author: @ralfhandl # Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432 # This workflow checks for changes of restricted files in a pull request