Skip to content

Commit f3c113a

Browse files
authored
Merge pull request #4409 from OAI/main-check-restricted-files-and-allow-some-PRs
main: check-restricted-files.yaml reports ok for intra-repo PRs that are allowed to change these files
2 parents c4f0205 + 037ebed commit f3c113a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/check-restricted-files.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,27 @@ jobs:
1818
- name: Check changed files
1919
shell: bash
2020
run: |
21+
if [[ "${{ github.event.pull_request.head.repo.full_name }}" == "OAI/OpenAPI-Specification" ]] && \
22+
[[ "${{ github.event.pull_request.base.repo.full_name }}" == "OAI/OpenAPI-Specification" ]]; then
23+
24+
if [[ "${{ github.event.pull_request.head.ref }}" == "main" ]] && \
25+
[[ "${{ github.event.pull_request.base.ref }}" == "dev" ]]; then
26+
echo Sync from main to dev
27+
exit 0
28+
fi
29+
30+
if [[ "${{ github.event.pull_request.head.ref }}" == "dev" ]] && \
31+
[[ "${{ github.event.pull_request.base.ref }}" =~ ^v[0-9]+\.[0-9]+-dev$ ]]; then
32+
echo Sync from dev to ${{ github.event.pull_request.base.ref }}
33+
exit 0
34+
fi
35+
36+
if [[ "${{ github.event.pull_request.head.ref }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rel$ ]] && \
37+
[[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
38+
echo Release from ${{ github.event.pull_request.head.ref }} to main
39+
exit 0
40+
fi
41+
fi
42+
2143
echo This PR contains changes to files that should not be changed
2244
exit 1

0 commit comments

Comments
 (0)