File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : check-restricted-files
2+
3+ # Author: @ralfhandl
4+ # Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432
5+
6+ # This workflow fails if restricted files are changed in a pull request
7+
8+ on :
9+ pull_request :
10+ paths :
11+ - " versions/[0-9].[0-9].[0-9].md"
12+
13+ jobs :
14+ check-files :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - uses : actions/checkout@v5 # checkout repo content
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Check changed files
22+ shell : bash
23+ run : |
24+ if [[ "${{ github.event.pull_request.head.repo.full_name }}" == "OAI/Overlay-Specification" ]] && \
25+ [[ "${{ github.event.pull_request.base.repo.full_name }}" == "OAI/Overlay-Specification" ]]; then
26+
27+ if [[ "${{ github.event.pull_request.head.ref }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rel$ ]] && \
28+ [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
29+ echo Release from ${{ github.event.pull_request.head.ref }} to main
30+ exit 0
31+ fi
32+ fi
33+
34+ echo This PR contains changes to files that should not be changed:
35+ echo
36+ git diff --compact-summary origin/${{ github.event.pull_request.base.ref }} origin/${{ github.event.pull_request.head.ref }} -- versions/[0-9].[0-9].[0-9].md
37+
38+ exit 1
You can’t perform that action at this time.
0 commit comments