diff --git a/.github/workflows/dependabot-pr-trimmer.yaml b/.github/workflows/dependabot-pr-trimmer.yaml deleted file mode 100644 index 83184ad11..000000000 --- a/.github/workflows/dependabot-pr-trimmer.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Trim parts of the Dependabot PR text that are unnecessary in the git history. -# -# The trimming needs to be performed before the PR is merged so that the commit -# message is based on the trimmed version. This prevents us from using events -# such as the PR getting closed or merged. Triggering on merge queue events is -# also problematic, because a merge_queue event doesn't have the equivalent of -# "pull_request.user" and we need that to test if the PR came from Dependabot. -# So instead, this workflow triggers when auto-merge is enabled for the PR. -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -name: Dependabot PR trimmer -run-name: Filter message body of PR ${{github.event.pull_request.number}} - -on: - pull_request: - types: - - auto_merge_enabled - - workflow_dispatch: - inputs: - pr-number: - description: 'The PR number of the PR to edit:' - type: string - required: true - -# Declare default permissions as read only. -permissions: read-all - -jobs: - filter-message: - name: Filter PR message body - runs-on: ubuntu-24.04 - timeout-minutes: 5 - permissions: - contents: read - pull-requests: write - issues: write - steps: - - if: >- - github.event.pull_request.user.login == 'dependabot[bot]' || - github.event_name == 'workflow_dispatch' - env: - GH_TOKEN: ${{github.token}} - pr-number: ${{inputs.pr-number || github.event.pull_request.number}} - run: | - gh pr view ${{env.pr-number}} -R ${{github.repository}} --json body -q .body |\ - sed '/(dependabot-automerge-end)/,/<\/details>/d' |\ - gh pr edit ${{env.pr-number}} -R ${{github.repository}} --body-file -