ignore #277
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: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Apply Spotless formatting if needed | |
| id: spotless_apply | |
| run: | | |
| if ./gradlew spotlessKotlinCheck; then | |
| echo "already_clean=true" >> $GITHUB_OUTPUT | |
| else | |
| ./gradlew spotlessApply | |
| echo "already_clean=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit Spotless fixes | |
| if: steps.spotless_apply.outputs.already_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 diff --cached --quiet || git commit -m "chore: auto-fix Spotless formatting" | |
| git push origin HEAD:${{ github.head_ref }} | |
| - name: Build with Gradle Wrapper | |
| run: ./gradlew build |