Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc8a902d

Browse files
committed
Add GHA testing whether files were added and deleted in the same PR.
1 parent3d940e3 commitc8a902d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎.github/workflows/clean_pr.yml

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp