every change from vaale #320
Workflow file for this run
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: | |
| types: [opened, synchronize, reopened] | |
| push: | |
| branches: [ master ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| 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 and push 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 origin HEAD:${{ github.head_ref || github.ref_name }} | |
| exit 0 | |
| - name: Build | |
| if: steps.spotless.outputs.clean == 'true' | |
| run: ./gradlew build |