From 20405a775bfe896f09d8c4793451ae75d254255a Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 8 Oct 2020 18:11:16 +0200 Subject: [PATCH 1/2] [CI skip] Added Imports cleanup action --- .github/workflows/imports-fix.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/imports-fix.yml diff --git a/.github/workflows/imports-fix.yml b/.github/workflows/imports-fix.yml new file mode 100644 index 000000000..152437949 --- /dev/null +++ b/.github/workflows/imports-fix.yml @@ -0,0 +1,30 @@ +name: Clean up Imports + +on: + pull_request: + branches: + - master + paths: + - 'src/main/java/**' + +jobs: + build: + + name: Clean up Imports + runs-on: ubuntu-latest + if: $ {{ secrets.ACCESS_TOKEN }} != null + + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.3 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1.4.3 + with: + java-version: 11 + - name: Clean up Imports + uses: axel-op/googlejavaformat-action@v3.3.2 + with: + files: '**/*.java' + skipCommit: false + args: "--fix-imports-only --replace" + githubToken: $ {{ secrets.ACCESS_TOKEN }} From 6f4802f7b608253408be64dc91a5828623304f71 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Thu, 8 Oct 2020 18:33:01 +0200 Subject: [PATCH 2/2] [CI skip] Fixed imports workflow --- .github/workflows/imports-fix.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/imports-fix.yml b/.github/workflows/imports-fix.yml index 152437949..6b19edbd4 100644 --- a/.github/workflows/imports-fix.yml +++ b/.github/workflows/imports-fix.yml @@ -12,7 +12,7 @@ jobs: name: Clean up Imports runs-on: ubuntu-latest - if: $ {{ secrets.ACCESS_TOKEN }} != null + if: github.event.pull_request.base.repo.full_name == 'Slimefun/Slimefun4' steps: - name: Checkout repository @@ -21,10 +21,10 @@ jobs: uses: actions/setup-java@v1.4.3 with: java-version: 11 - - name: Clean up Imports + - name: Google Java Format uses: axel-op/googlejavaformat-action@v3.3.2 with: files: '**/*.java' skipCommit: false args: "--fix-imports-only --replace" - githubToken: $ {{ secrets.ACCESS_TOKEN }} + githubToken: ${{ secrets.ACCESS_TOKEN }}