Attacks, fixes #424
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: Update Resources | |
on: [push, workflow_dispatch] | |
permissions: {} | |
jobs: | |
runPush: | |
permissions: | |
contents: write # for Update bundles | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
- name: Update bundles | |
if: ${{ github.repository == 'IriDark/Valoria' }} | |
run: | | |
./gradlew updateResources | |
if [ -n "$(git status --porcelain -- src/main/resources/)" ]; then | |
git config --global user.email "actions@github.com" | |
git config --global user.name "Github Actions" | |
git pull | |
git add src/main/resources/* | |
git commit -m "Automatic resources update" | |
git push | |
fi |