Merge pull request #122 from pig-mesh/auto-format-218 #219
This file contains hidden or 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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: excel 组件 构建action | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: mvn clean install | |
run: mvn clean install | |
- name: mvn spring-javaformat:validate | |
id: validate | |
run: mvn spring-javaformat:validate | |
continue-on-error: true | |
- name: Auto format code if validation fails | |
if: steps.validate.outcome == 'failure' | |
run: mvn spring-javaformat:apply | |
- name: Create Pull Request for formatting changes | |
if: steps.validate.outcome == 'failure' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'Auto-format code with spring-javaformat' | |
title: 'Auto-format: Fix code formatting issues' | |
body: | | |
This PR was automatically created because the spring-javaformat validation failed. | |
The following changes have been applied: | |
- Applied spring-javaformat:apply to fix formatting issues | |
Please review and merge if the changes look correct. | |
branch: auto-format-${{ github.run_number }} | |
delete-branch: true |