8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d940e3 commit c8a902dCopy full SHA for c8a902d
.github/workflows/clean_pr.yml
@@ -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