Skip to content

Commit

Permalink
Test auto lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Nov 15, 2023
1 parent c2b273e commit 482c3d0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Automatically lint code

on: [pull_request]

permissions:
contents: write

jobs:
lint:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.dubbo-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
- uses: actions/cache@v3
name: "Cache local Maven repository"
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- name: "Lint with Maven"
run: |
./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast spotless:apply
- name: Check for changes
run: git status
- name: Commit and push files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Found changes"
git add .
git commit -m "Auto lint styles"
git push
fi

0 comments on commit 482c3d0

Please sign in to comment.