diff --git a/.github/scripts/generate-release-contributors.sh b/.github/scripts/generate-release-contributors.sh index 1fffa9279..1e1fdc7f2 100755 --- a/.github/scripts/generate-release-contributors.sh +++ b/.github/scripts/generate-release-contributors.sh @@ -88,4 +88,5 @@ echo $contributors1 $contributors2 \ | grep -v dependabot \ | grep -v renovate \ | grep -v opentelemetrybot \ + | grep -v otelbot \ | sed 's/^/@/' diff --git a/.github/scripts/use-cla-approved-bot.sh b/.github/scripts/use-cla-approved-bot.sh new file mode 100644 index 000000000..149a13d9b --- /dev/null +++ b/.github/scripts/use-cla-approved-bot.sh @@ -0,0 +1,4 @@ +#!/bin/bash -e + +git config user.name otelbot +git config user.email 197425009+otelbot@users.noreply.github.com diff --git a/.github/scripts/use-cla-approved-github-bot.sh b/.github/scripts/use-cla-approved-github-bot.sh deleted file mode 100755 index a4c68b0e3..000000000 --- a/.github/scripts/use-cla-approved-github-bot.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -e - -git config user.name opentelemetrybot -git config user.email 107717825+opentelemetrybot@users.noreply.github.com diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e1828cf17..ed678bdd5 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -26,19 +26,25 @@ jobs: # history is needed to run git cherry-pick below fetch-depth: 0 - - name: Use CLA approved github bot - run: .github/scripts/use-cla-approved-github-bot.sh + - name: Use CLA approved bot + run: .github/scripts/use-cla-approved-bot.sh + + - uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3 + 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 - GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GH_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 checkout -b $branch git cherry-pick $commit diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 6bbbba221..13debe9ac 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -44,16 +44,22 @@ jobs: date=$(date "+%Y-%m-%d") sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md - - name: Use CLA approved github bot - run: .github/scripts/use-cla-approved-github-bot.sh + - name: Use CLA approved bot + run: .github/scripts/use-cla-approved-bot.sh + + - uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} - name: Create pull request env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Prepare release $VERSION" - branch="opentelemetrybot/prepare-release-${VERSION}" + branch="otelbot/prepare-release-${VERSION}" git checkout -b $branch git commit -a -m "$message" diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index 782cfc716..a1bca779c 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -56,16 +56,22 @@ jobs: date=$(date "+%Y-%m-%d") sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md - - name: Use CLA approved github bot - run: .github/scripts/use-cla-approved-github-bot.sh + - name: Use CLA approved bot + run: .github/scripts/use-cla-approved-bot.sh + + - uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} - name: Create pull request against the release branch env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Prepare release $VERSION" - branch="opentelemetrybot/prepare-release-${VERSION}" + branch="otelbot/prepare-release-${VERSION}" git checkout -b $branch git commit -a -m "$message" @@ -107,17 +113,23 @@ jobs: date=$(date "+%Y-%m-%d") sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version $VERSION ($date)/" CHANGELOG.md - - name: Use CLA approved github bot - run: .github/scripts/use-cla-approved-github-bot.sh + - name: Use CLA approved bot + run: .github/scripts/use-cla-approved-bot.sh + + - uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} - name: Create pull request against main env: # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | message="Update version to $NEXT_VERSION" body="Update version to \`$NEXT_VERSION\`." - branch="opentelemetrybot/update-version-to-${NEXT_VERSION}" + branch="otelbot/update-version-to-${NEXT_VERSION}" git checkout -b $branch git commit -a -m "$message" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2caaaaba4..88d31f024 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -218,14 +218,20 @@ jobs: release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//') RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh - - name: Use CLA approved github bot - run: .github/scripts/use-cla-approved-github-bot.sh + - name: Use CLA approved bot + run: .github/scripts/use-cla-approved-bot.sh + + - uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3 + id: otelbot-token + with: + app-id: ${{ vars.OTELBOT_APP_ID }} + private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }} - name: Create pull request against main env: VERSION: ${{ needs.release.outputs.version }} # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows - GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} run: | if git diff --quiet; then if [[ $VERSION == *.0 ]]; then @@ -239,7 +245,7 @@ jobs: message="Merge change log updates from $GITHUB_REF_NAME" body="Merge log updates from \`$GITHUB_REF_NAME\`." - branch="opentelemetrybot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}" + branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}" git checkout -b $branch git commit -a -m "$message"