Skip to content

Commit

Permalink
ci: reduce unnecessary pr-filter runs (#2033)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
cotes2020 authored Nov 8, 2024
1 parent 2f84497 commit d51345e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
check-template:
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/scripts/pr-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ module.exports = async ({ github, context, core }) => {
const action = context.payload.action;

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

if (!isValid) {
await github.rest.pulls.update({
Expand Down

0 comments on commit d51345e

Please sign in to comment.