Update Java Download Status #62
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: Update Java Download Status | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Run daily at midnight | |
| workflow_dispatch: # Allow manual triggering | |
| # Needed for dependency-submission-action | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-status: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Install dependencies | |
| run: | | |
| mvn install -DskipTests | |
| - name: Run Java Version Checker | |
| run: | | |
| cd scr | |
| java -jar target/java-version-checker-jar-with-dependencies.jar > ../java_status.json | |
| - name: Update README files | |
| run: | | |
| cd scr | |
| java -jar target/readme-updater-jar-with-dependencies.jar | |
| - name: Commit and push if changed | |
| run: | | |
| git config --global user.name 'GitHub Action' | |
| git config --global user.email '[email protected]' | |
| git add . | |
| git diff --quiet && git diff --staged --quiet || git commit -m "Update Java download status" | |
| git push |