Skip to content

Commit fa1f64a

Browse files
committed
Create check-restricted-files.yaml
Simple workflow to check for changes to files in schemas and versions folder
1 parent b5ab378 commit fa1f64a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: check-restricted-files
2+
3+
# Autor: @ralfhandl
4+
# Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432
5+
6+
# This workflow checks for changes of restricted files in a pull request
7+
8+
on:
9+
- pull_request
10+
11+
jobs:
12+
check-files:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check changed files
21+
shell: bash
22+
run: |
23+
set +e
24+
25+
git diff --exit-code --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} \
26+
-- schemas versions
27+
if [[ $? -ne 0 ]]; then
28+
echo This PR contains changes to files that should not be changed on ${{ github.event.pull_request.base.ref }}
29+
exit 1
30+
fi

0 commit comments

Comments
 (0)