Skip to content

Update: Code format checker workflow #5

Update: Code format checker workflow

Update: Code format checker workflow #5

name: "Google-java-format"
run-name: ""
on:
push:
branches:
- "*"
branches_ignore:
- "develop"
- "main"
pull_request:
branches:
- "*"
env:
VERSION: 1.22.0
jobs:
format: # job_id
name: java-format-check
if: github.repository == 's-bose7/open-banking-suite'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Checkout Pull Request Code
uses: actions/checkout@v4
- uses: robinraju/release-downloader@v1
with:
repository: 'google/google-java-format'
tag: "v${{env.VERSION}}"
fileName: "google-java-format-${{env.VERSION}}-all-deps.jar"
out-file-path: '.ci-temp'
- name: Run Formatting
run: |
java -jar .ci-temp/google-java-format-${{env.VERSION}}-all-deps.jar --replace $(find . -name "*.java")
- name: Cleanup
if: always()
run: |
rm -rf .ci-temp
rm -f changed_files.txt