Skip to content

Commit d51345e

Browse files
authored
ci: reduce unnecessary pr-filter runs (cotes2020#2033)
- Checking the repository of the PR is more effective than checking the label to identify bot-initiated PRs - This change also allows more flexible PR body definitions for developers with write access to the repository
1 parent 2f84497 commit d51345e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/pr-filter.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
check-template:
9+
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
910
runs-on: ubuntu-latest
1011
permissions:
1112
pull-requests: write

.github/workflows/scripts/pr-filter.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ module.exports = async ({ github, context, core }) => {
1616
const action = context.payload.action;
1717

1818
const isValid =
19-
pr.labels.length > 0 || // PR create by Dependabot would have labels
20-
(markdown !== '' && hasTypes(markdown) && hasDescription(markdown));
19+
markdown !== '' && hasTypes(markdown) && hasDescription(markdown);
2120

2221
if (!isValid) {
2322
await github.rest.pulls.update({

0 commit comments

Comments
 (0)