Allow build job to write contents #40
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: Java CI with Maven | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
- run: mvn -B verify | |
- uses: madrapps/[email protected] | |
with: | |
paths: ${{ github.workspace }}/target/site/jacoco/jacoco.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 80 | |
min-coverage-changed-files: 80 | |
- uses: cicirello/[email protected] | |
- if: github.ref == 'refs/heads/main' | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name "Matomo Java Tracker" | |
git config --global user.email "[email protected]" | |
git add -A | |
git commit -m "Autogenerated JaCoCo coverage badge" | |
git push | |
fi |