Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16a548e

Browse files
committed
Verify that lib/src is not changed on -doc backports
1 parent 57dc5f7 commit 16a548e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/clean_pr.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ jobs:
3030
printf 'The following images were both added and modified in this PR:\n%s\n' "$am"
3131
exit 1
3232
fi
33+
- name: Check for invalid backports to -doc branches
34+
if: endsWith(github.base_ref, '-doc')
35+
run: |
36+
git fetch --quiet origin "$GITHUB_BASE_REF"
37+
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
38+
lib="$(git log "$base..HEAD^2" --pretty=tformat: --name-status -- lib src |
39+
cut --fields 2 | sort | uniq --repeated || true)"
40+
if [[ -n "$lib" ]]; then
41+
printf 'Changes to the following files have no effect and should not be backported:\n%s\n' "$lib"
42+
exit 1
43+
fi

0 commit comments

Comments
 (0)