Skip to content

Commit 6cebe46

Browse files
authored
Merge pull request #21833 from QuLogic/clean-doc-backports
CI: Enforce backport conditions on v*-doc branches
2 parents 51f10e2 + dce55e2 commit 6cebe46

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.circleci/config.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,15 @@ commands:
104104
steps:
105105
- run:
106106
name: Install Matplotlib
107-
command: python -m pip install --user -ve .
107+
command: |
108+
if [[ "$CIRCLE_BRANCH" == v*-doc ]]; then
109+
# The v*-doc branches must build against the specified release.
110+
version=${CIRCLE_BRANCH%-doc}
111+
version=${version#v}
112+
python -m pip install matplotlib==${version}
113+
else
114+
python -m pip install --user -ve .
115+
fi
108116
- save_cache:
109117
key: build-deps-1
110118
paths:

.github/workflows/clean_pr.yml

+11
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 || 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)