8000 Backport PR #21833: Enforce backport conditions on v*-doc branches · matplotlib/matplotlib@8ae93c1 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ae93c1

Browse files
committed
Backport PR #21833: Enforce backport conditions on v*-doc branches
Merge pull request #21833 from QuLogic/clean-doc-backports CI: Enforce backport conditions on v*-doc branches
1 parent a072d32 commit 8ae93c1

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.circleci/config.yml

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

.github/workflows/clean_pr.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,25 @@ jobs:
1919
printf 'The following files were both added and deleted in this PR:\n%s\n' "$ad"
2020
exit 1
2121
fi
22-
22+
- name: Check for added-and-modified images
23+
run: |
24+
git fetch --quiet origin "$GITHUB_BASE_REF"
25+
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
26+
am="$(git log "$base..HEAD^2" --pretty=tformat: --name-status --diff-filter=AM |
27+
cut --fields 2 | sort | uniq --repeated |
28+
grep -E '\.(png|pdf|ps|eps|svg)' || true)"
29+
if [[ -n "$am" ]]; then
30+
printf 'The following images were both added and modified in this PR:\n%s\n' "$am"
31+
exit 1
32+
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)
0