Run bot #5248
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: Run bot | |
on: | |
push: | |
schedule: | |
- cron: '0 */4 * * *' | |
jobs: | |
run: | |
if: contains(toJson(github.event.commits), '[ci skip]') == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout master branch | |
uses: actions/checkout@master | |
with: | |
ref: master | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build app | |
run: ./gradlew clean bootJar detekt | |
- name: Run app | |
run: java -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dfile.encoding=UTF-8 -jar build/libs/software-updates-bot-0.0.1-SNAPSHOT.jar | |
- name: Commit and push changes | |
run: | | |
git add report/*.md | |
git add report/*.json | |
git add report/*.xml | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "no changes detected" | |
exit 0 | |
fi | |
git config --local user.email "[email protected]" | |
git config --local user.name "Jonathan Lermitage software-updates-bot" | |
git commit -m "autocommit by bot [ci skip]" | |
git push | |
echo "pushed changes" |