From 613e659379e50b141d1494cf7ac4f22cee246998 Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Fri, 13 Dec 2024 09:54:19 +0100 Subject: [PATCH] chore-add-dependabot-auto-update-workflow (#1828) Co-authored-by: Pierre Tessier --- .../dependabot-auto-update-protobuf-diff.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/dependabot-auto-update-protobuf-diff.yml diff --git a/.github/workflows/dependabot-auto-update-protobuf-diff.yml b/.github/workflows/dependabot-auto-update-protobuf-diff.yml new file mode 100644 index 0000000000..22d8f473f1 --- /dev/null +++ b/.github/workflows/dependabot-auto-update-protobuf-diff.yml @@ -0,0 +1,35 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +on: + pull_request: + branches: [ main ] + +permissions: + actions: write + pull-requests: write + contents: write + packages: write + +jobs: + dependabot-auto-update-protobuf-diff: + runs-on: ubuntu-latest + # Only run this job if the PR is opened by dependabot and the last commit is from dependabot + if: github.event.pull_request.user.login == 'dependabot[bot]' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.DEPENDABOT_TOKEN }} + - name: Generate + run: make clean docker-generate-protobuf + - name: Commit only if there are changes + run: | + if ! git diff --quiet; then + git config user.name "dependabot[bot]" + git config user.email "49699333+dependabot[bot]@users.noreply.github.com" + git add . + git commit -s -m "chore: update protobuf" + git push + fi