Merge pull request #72 from team4099/aiminauto #292
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
| name: Build Project | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ master ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Check spotless | |
| id: spotless | |
| run: | | |
| if ./gradlew spotlessKotlinCheck; then | |
| echo "clean=true" >> $GITHUB_OUTPUT | |
| else | |
| ./gradlew spotlessApply | |
| echo "clean=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit spotless fixes | |
| if: steps.spotless.outputs.clean == 'false' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: auto-fix Spotless formatting" | |
| git push | |
| exit 0 | |
| - name: Build | |
| if: steps.spotless.outputs.clean == 'true' | |
| run: ./gradlew build |