From 544a167bd54e8c1358ad0e413407d4664dfbfc1c Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 20 Nov 2025 10:39:16 -0800 Subject: [PATCH] Remove auto spotless workflow --- .github/workflows/auto-spotless-apply.yml | 94 ----------------------- .github/workflows/auto-spotless-check.yml | 55 ------------- 2 files changed, 149 deletions(-) delete mode 100644 .github/workflows/auto-spotless-apply.yml delete mode 100644 .github/workflows/auto-spotless-check.yml diff --git a/.github/workflows/auto-spotless-apply.yml b/.github/workflows/auto-spotless-apply.yml deleted file mode 100644 index c001c8598..000000000 --- a/.github/workflows/auto-spotless-apply.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Auto spotless apply -on: - workflow_run: - workflows: - - "Auto spotless check" - types: - - completed - -permissions: - contents: read - -jobs: - apply: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Download patch - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 - with: - run-id: ${{ github.event.workflow_run.id }} - path: ${{ runner.temp }} - merge-multiple: true - github-token: ${{ github.token }} - - - id: unzip-patch - name: Unzip patch - working-directory: ${{ runner.temp }} - run: | - if [ -f patch ]; then - echo "exists=true" >> $GITHUB_OUTPUT - fi - - - uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 - if: steps.unzip-patch.outputs.exists == 'true' - id: otelbot-token - with: - app-id: 1296620 - private-key: ${{ secrets.OTELBOT_JAVA_CONTRIB_PRIVATE_KEY }} - - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - if: steps.unzip-patch.outputs.exists == 'true' - with: - repository: "${{ github.event.workflow_run.head_repository.full_name }}" - ref: "${{ github.event.workflow_run.head_branch }}" - token: ${{ steps.otelbot-token.outputs.token }} - - - name: Use CLA approved github bot - if: steps.unzip-patch.outputs.exists == 'true' - # IMPORTANT do not call the .github/scripts/use-cla-approved-bot.sh - # since that script could have been compromised in the PR branch - run: | - git config user.name otelbot - git config user.email 197425009+otelbot@users.noreply.github.com - - - name: Apply patch and push - if: steps.unzip-patch.outputs.exists == 'true' - run: | - git apply "${{ runner.temp }}/patch" - git commit -a -m "./gradlew spotlessApply" - git push - - - id: get-pr - if: steps.unzip-patch.outputs.exists == 'true' - name: Get PR - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ github.token }} - PR_BRANCH: |- - ${{ - (github.event.workflow_run.head_repository.owner.login != github.event.workflow_run.repository.owner.login) - && format('{0}:{1}', github.event.workflow_run.head_repository.owner.login, github.event.workflow_run.head_branch) - || github.event.workflow_run.head_branch - }} - run: | - number=$(gh pr view "$PR_BRANCH" --json number --jq .number) - echo "number=$number" >> $GITHUB_OUTPUT - - - if: steps.unzip-patch.outputs.exists == 'true' && success() - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} - PR_NUMBER: ${{ steps.get-pr.outputs.number }} - run: | - gh pr comment $PR_NUMBER --body "🔧 The result from spotlessApply was committed to the PR branch." - - - if: steps.unzip-patch.outputs.exists == 'true' && failure() - env: - GH_REPO: ${{ github.repository }} - GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} - PR_NUMBER: ${{ steps.get-pr.outputs.number }} - run: | - gh pr comment $PR_NUMBER --body "❌ The result from spotlessApply could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID." diff --git a/.github/workflows/auto-spotless-check.yml b/.github/workflows/auto-spotless-check.yml deleted file mode 100644 index f75b8c9a9..000000000 --- a/.github/workflows/auto-spotless-check.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Auto spotless check -on: - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - name: Set up JDK for running Gradle - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: temurin - java-version: 21 - - - name: Set up gradle - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 - with: - cache-read-only: true - - - name: Check out PR branch - env: - GH_TOKEN: ${{ github.token }} - run: gh pr checkout ${{ github.event.pull_request.number }} - - - name: Spotless - run: ./gradlew spotlessApply - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - - - id: create-patch - name: Create patch file - run: | - git diff > patch - if [ -s patch ]; then - echo "exists=true" >> "$GITHUB_OUTPUT" - fi - - - name: Upload patch file - if: steps.create-patch.outputs.exists == 'true' - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 - with: - path: patch - name: patch