From c68044f58371bec10dd78dcad876eb8b188dc65e Mon Sep 17 00:00:00 2001 From: otelbot <197425009+otelbot@users.noreply.github.com> Date: Mon, 14 Jul 2025 09:52:28 -0700 Subject: [PATCH] Migrate from opentelemetrybot to otelbot --- .../scripts/use-cla-approved-github-bot.sh | 4 ++-- .github/workflows/backport.yml | 10 ++++++++-- .github/workflows/changelog.yml | 2 +- .github/workflows/check-links.yml | 2 +- .github/workflows/misc_0.yml | 6 +++--- .github/workflows/prepare-patch-release.yml | 10 ++++++++-- .github/workflows/prepare-release-branch.yml | 20 +++++++++++++++---- .github/workflows/templates/misc.yml.j2 | 6 +++--- 8 files changed, 42 insertions(+), 18 deletions(-) diff --git a/.github/scripts/use-cla-approved-github-bot.sh b/.github/scripts/use-cla-approved-github-bot.sh index a4c68b0e308..149a13d9b93 100755 --- a/.github/scripts/use-cla-approved-github-bot.sh +++ b/.github/scripts/use-cla-approved-github-bot.sh @@ -1,4 +1,4 @@ #!/bin/bash -e -git config user.name opentelemetrybot -git config user.email 107717825+opentelemetrybot@users.noreply.github.com +git config user.name otelbot +git config user.email 197425009+otelbot@users.noreply.github.com diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 26789093f25..247e438149d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -24,16 +24,22 @@ jobs: - name: Use CLA approved github bot run: .github/scripts/use-cla-approved-github-bot.sh + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} + - name: Create pull request env: NUMBER: ${{ github.event.inputs.number }} # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid) title=$(gh pr view $NUMBER --json title --jq .title) - branch="opentelemetrybot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}" + branch="otelbot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}" git cherry-pick $commit git push origin HEAD:$branch diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 491ddd27fae..4fcb55a2d75 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest if: | !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') - && github.actor != 'opentelemetrybot' + && github.actor != 'otelbot[bot]' steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 9092cbaf789..a31f79cbc07 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest needs: changedfiles if: | - github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request' + github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' && ${{needs.changedfiles.outputs.md}} steps: - name: Checkout Repo diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml index 3fb9266cc02..fd357afaae5 100644 --- a/.github/workflows/misc_0.yml +++ b/.github/workflows/misc_0.yml @@ -90,7 +90,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 if: | - github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request' + github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' steps: - name: Checkout repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 @@ -150,7 +150,7 @@ jobs: timeout-minutes: 30 if: | !contains(github.event.pull_request.labels.*.name, 'Approve Public API check') - && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request' + && github.actor != 'otelbot[bot]' && github.event_name == 'pull_request' steps: - name: Checkout repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 @@ -202,7 +202,7 @@ jobs: timeout-minutes: 30 if: | !contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows') - && github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request' + && github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' steps: - name: Checkout repo @ SHA - ${{ github.sha }} uses: actions/checkout@v4 diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 680b3842b99..c78a7306cef 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -64,14 +64,20 @@ jobs: - name: Use CLA approved github bot run: .github/scripts/use-cla-approved-github-bot.sh + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} + - name: Create pull request id: create_pr env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Prepare release ${STABLE_VERSION}/${UNSTABLE_VERSION}" - branch="opentelemetrybot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}" + branch="otelbot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}" git commit -a -m "$message" git push origin HEAD:$branch diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index edb906ed16c..df399e879c8 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -90,14 +90,20 @@ jobs: - name: Use CLA approved github bot run: .github/scripts/use-cla-approved-github-bot.sh + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} + - name: Create pull request against the release branch id: create_release_branch_pr env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Prepare release ${STABLE_VERSION}/${UNSTABLE_VERSION}" - branch="opentelemetrybot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}" + branch="otelbot/prepare-release-${STABLE_VERSION}-${UNSTABLE_VERSION}" git commit -a -m "$message" git push origin HEAD:$branch @@ -178,15 +184,21 @@ jobs: - name: Use CLA approved github bot run: .github/scripts/use-cla-approved-github-bot.sh + - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} + - name: Create pull request against main id: create_main_pr env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Update version to ${STABLE_NEXT_VERSION}/${UNSTABLE_NEXT_VERSION}" body="Update version to \`${STABLE_NEXT_VERSION}/${UNSTABLE_NEXT_VERSION}\`." - branch="opentelemetrybot/update-version-to-${STABLE_NEXT_VERSION}-${UNSTABLE_NEXT_VERSION}" + branch="otelbot/update-version-to-${STABLE_NEXT_VERSION}-${UNSTABLE_NEXT_VERSION}" git commit -a -m "$message" git push origin HEAD:$branch diff --git a/.github/workflows/templates/misc.yml.j2 b/.github/workflows/templates/misc.yml.j2 index d2f5fed3b83..ff46c7f742e 100644 --- a/.github/workflows/templates/misc.yml.j2 +++ b/.github/workflows/templates/misc.yml.j2 @@ -36,16 +36,16 @@ jobs: {%- if job_data == "generate-workflows" %} if: | !contains(github.event.pull_request.labels.*.name, 'Skip generate-workflows') - && github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request' + && github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' {%- endif %} {%- if job_data == "public-symbols-check" %} if: | !contains(github.event.pull_request.labels.*.name, 'Approve Public API check') - && github.actor != 'opentelemetrybot' && github.event_name == 'pull_request' + && github.actor != 'otelbot[bot]' && github.event_name == 'pull_request' {%- endif %} {%- if job_data == "docs" %} if: | - github.event.pull_request.user.login != 'opentelemetrybot' && github.event_name == 'pull_request' + github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request' {%- endif %} steps: - name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}