Skip to content

Commit 2e8b53c

Browse files
committed
Add workflow to trim Dependabot PR message bodies
Remove the command summary, because when using merge queues the resulting commit messages are overly bloated.
1 parent e604d1b commit 2e8b53c

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
# Remove bloat from Dependabot's PR messages
17+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
19+
name: Dependabot PR trimmer
20+
run-name: Filter message body of PR #
21+
22+
on:
23+
pull_request:
24+
types: [opened]
25+
workflow_dispatch:
26+
inputs:
27+
pr-number:
28+
description: 'The PR number of the PR to edit:'
29+
type: string
30+
required: true
31+
32+
jobs:
33+
setup:
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 5
36+
steps:
37+
- if: >-
38+
github.event.pull_request.user.login == 'dependabot[bot]' ||
39+
github.event_name == 'workflow_dispatch'
40+
env:
41+
pr-number: ${{inputs.pr-number || github.event.pull_request.number}}
42+
run: |
43+
gh pr view ${{env.pr-number}} --json body --jq .body |\
44+
sed '/(dependabot-automerge-end)/,/<\/details>/d' |\
45+
gh pr edit ${{env.pr-number}} --body-file -

0 commit comments

Comments
 (0)