Skip to content

main: status check for changes to versions and schemas folder #12

main: status check for changes to versions and schemas folder

main: status check for changes to versions and schemas folder #12

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
# run this on push to any branch and creation or review of pull-requests
on:
# - push
- pull_request
# - pull_request_review
jobs:
check-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check changed files
id: check-changes
shell: bash
run: |
# TODO: skip if base.ref is main
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