Add spotless and spotless workflow #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Enforce proper formatting | |
on: pull_request | |
jobs: | |
gradle: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute Gradle build | |
run: ./gradlew spotlessApply | |
- name: Commit fixed formatting | |
run: | | |
git config user.name "Yeti Formatter" | |
git config user.email "<>" | |
git commit -am "Fix formatting" | |
- name: Push changes | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
BASE_REF: ${{ github.base_ref }} | |
run: | | |
echo "${HEAD_REF}" | |
echo "${BASE_REF}" |