Skip to content

[workflow]: Bump actions/checkout from 1 to 4 in the dependencies group #12

[workflow]: Bump actions/checkout from 1 to 4 in the dependencies group

[workflow]: Bump actions/checkout from 1 to 4 in the dependencies group #12

Workflow file for this run

name: auto-format
on: [push, pull_request, workflow_dispatch]
jobs:
format:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Maven cache
uses: actions/cache@v4
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Run Formatter
run: mvn com.spotify.fmt:fmt-maven-plugin:format -DskipTestSourceDirectory=true -DskipSortingImports=true
- name: Check for modified files
id: git-check
run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
- name: Commit & Push changes
if: steps.git-check.outputs.modified == 'true'
uses: actions-js/push@master
with:
message: "Google-Java-Format"
branch: "master"
github_token: ${{ secrets.GITHUB_TOKEN }}