Skip to content

Commit a963ad6

Browse files
committed
Simplified approach
1 parent fa1f64a commit a963ad6

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
name: check-restricted-files
22

3-
# Autor: @ralfhandl
3+
# Author: @ralfhandl
44
# Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432
55

6-
# This workflow checks for changes of restricted files in a pull request
6+
# This workflow fails if restricted files are changed in a pull request
77

88
on:
9-
- pull_request
9+
pull_request:
10+
paths:
11+
- 'schemas/**/*.yaml'
12+
- 'versions/*.md'
1013

1114
jobs:
1215
check-files:
1316
runs-on: ubuntu-latest
1417
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
2018
- name: Check changed files
2119
shell: bash
2220
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
21+
echo This PR contains changes to files that should not be changed
22+
exit 1

0 commit comments

Comments
 (0)