This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
Formatting CI #219
This file contains 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: Formatting CI | |
on: | |
push: | |
branches: [ "**" ] | |
pull_request: | |
branches: [ "**" ] | |
schedule: | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: {ref: ""} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Formatting the code | |
run: ./gradlew spotlessApply | |
- name: Compile and run tests on robot code | |
run: ./gradlew spotlessCheck | |
- name: Commit back to GitHub | |
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'}} | |
run: | | |
git config --global user.name "github-actiuons[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "Formatting" | |
git push -u origin ${GITHUB_REF} | |
fi |