From 7715854b7034c4324c84942f919118b0d1ce66bb Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 8 Oct 2024 01:01:02 +0200 Subject: [PATCH] ci: remove auto bot format (#276) * remove format workflow * remove --- .github/workflows/format.yml | 35 -------------------------------- scripts/commit-formatted-code.sh | 16 --------------- 2 files changed, 51 deletions(-) delete mode 100644 .github/workflows/format.yml delete mode 100755 scripts/commit-formatted-code.sh diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 0720e5cd..00000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Format Code -on: - pull_request: - -jobs: - format-code: - name: Format Code - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: set up JDK 11 - uses: actions/setup-java@v3 - with: - distribution: "adopt" - java-version: "17" - - - name: Cache Gradle packages - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Make format - run: make format - - # actions/checkout fetches only a single commit in a detached HEAD state. Therefore - # we need to pass the current branch, otherwise we can't commit the changes. - # GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs. - - name: Commit Formatted Code - run: ./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF diff --git a/scripts/commit-formatted-code.sh b/scripts/commit-formatted-code.sh deleted file mode 100755 index 24bba6f6..00000000 --- a/scripts/commit-formatted-code.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euo pipefail - -GITHUB_BRANCH="${1}" - -if [[ $(git status) == *"nothing to commit"* ]]; then - echo "Nothing to commit. All code formatted correctly." -else - echo "Formatted some code. Going to push the changes." - git config --global user.name 'Sentry Github Bot' - git config --global user.email 'bot+github-bot@sentry.io' - git fetch - git checkout ${GITHUB_BRANCH} - git commit -am "Format code" - git push --set-upstream origin ${GITHUB_BRANCH} -fi