Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12ff724 commit f3f4a99Copy full SHA for f3f4a99
1 file changed
.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