From 9b16b3213a59779777fcc1106b73860a094ea3d0 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 24 Nov 2025 08:44:56 -0800 Subject: [PATCH] Remove auto spotless workflow --- .github/workflows/auto-spotless.yml | 57 ---------- .../workflows/auto-update-pull-request.yml | 107 ------------------ 2 files changed, 164 deletions(-) delete mode 100644 .github/workflows/auto-spotless.yml delete mode 100644 .github/workflows/auto-update-pull-request.yml diff --git a/.github/workflows/auto-spotless.yml b/.github/workflows/auto-spotless.yml deleted file mode 100644 index c1e98318cd68..000000000000 --- a/.github/workflows/auto-spotless.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Auto spotless -on: - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - check: - if: ${{ github.event.pull_request.draft == false }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - name: Free disk space - run: .github/scripts/gha-free-disk-space.sh - - - name: Set up JDK for running Gradle - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: temurin - java-version-file: .java-version - - - 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 - - - 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 diff --git a/.github/workflows/auto-update-pull-request.yml b/.github/workflows/auto-update-pull-request.yml deleted file mode 100644 index 7d93cadcdd01..000000000000 --- a/.github/workflows/auto-update-pull-request.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Auto update pull request -on: - workflow_run: - workflows: - - "Auto spotless" - - "Auto license report" - 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: 1295839 - private-key: ${{ secrets.OTELBOT_JAVA_INSTRUMENTATION_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 - - - id: gradle-task - if: steps.unzip-patch.outputs.exists == 'true' - run: | - if [[ "${{ github.event.workflow_run.name }}" == "Auto spotless" ]]; then - echo "name=spotlessApply" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.workflow_run.name }}" == "Auto license report" ]]; then - echo "name=generateLicenseReport" >> $GITHUB_OUTPUT - else - echo "name=unknown" >> $GITHUB_OUTPUT - fi - - - name: Apply patch and push - if: steps.unzip-patch.outputs.exists == 'true' - run: | - git apply "${{ runner.temp }}/patch" - git add licenses - git commit -a -m "./gradlew ${{ steps.gradle-task.outputs.name }}" - 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 ${{ steps.gradle-task.outputs.name }} 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 ${{ steps.gradle-task.outputs.name }} could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."