Skip to content

Commit 049bf04

Browse files
committed
check-restricted-files.yaml: check for allowed PRs
Check in the whether the PR is an intra-repo - sync PR or - release PR and report "ok" for these. Conditions: - PR's `head` and `base` org is `OAI/OpenAPI-Specification` and - `head` is `main` and `base` is `dev`, or - `head` is `dev` and `base` matches `v?.?-dev`, or - `head` matches `v?.?.?-rel` and `base` is `main`
1 parent 249dcef commit 049bf04

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
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)