Skip to content

Navigation Menu

Sign in
Appearance settings

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 f3f4a99

Browse filesBrowse files
committed
Add GHA testing whether files were added and deleted in the same PR.
1 parent 12ff724 commit f3f4a99
Copy full SHA for f3f4a99

File tree

Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-0
lines changed

‎.github/workflows/clean_pr.yml

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR cleanliness
2+
on: [pull_request]
3+
4+
jobs:
5+
pr_clean:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: '0'
12+
- name: Check for added-and-deleted files
13+
run: |
14+
git fetch --quiet origin "$GITHUB_BASE_REF"
15+
base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')"
16+
ad="$(git log "$base..HEAD^2" --pretty=tformat: --name-status --diff-filter=AD |
17+
cut --fields 2 | sort | uniq --repeated)"
18+
if [[ -n "$ad" ]]; then
19+
printf 'The following files were both added and deleted in this PR:\n%s\n' "$ad"
20+
exit 1
21+
fi
22+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.