malliaridis commented on code in PR #2880:
URL: https://github.com/apache/solr/pull/2880#discussion_r1850666596
##########
.github/workflows/gradle-precommit.yml:
##########
@@ -1,17 +1,80 @@
name: Gradle Precommit
-on:
+on:
pull_request:
branches:
- 'main'
- 'branch_*'
jobs:
+ # Dependabot job that runs only for dependabot PRs
+ # This job is writing locks, updates checksums, and commits the changes on
the dependabot PRs.
+ dependabot:
+ name: gradle check
+
+ runs-on: ubuntu-latest
+
+ # Run only on dependabot PRs (see dependabot-actions.yml)
+ if: github.actor == 'dependabot[bot]'
+
+ env:
+ DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
+
+ # Give the default GITHUB_TOKEN write permission to commit
+ # and push the changed files back to the repository.
+ permissions:
+ contents: write
+
+ steps:
+ - name: Checkout project
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.head_ref }}
+
+ - name: Set up JDK
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: 21
+ java-package: jdk
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v4
+
+ - name: Grant execute permission for gradlew
+ run: chmod +x gradlew
+
+ - name: Use Gradle cache
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-precommit-${{
hashFiles('versions.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-gradle-precommit-
+ ${{ runner.os }}-gradle-
+
+ - name: Write locks
+ run: ./gradlew writeLocks
+
+ - name: Update licenses / checksums
+ run: ./gradlew updateLicenses
+
+ - name: Commit and push changes
+ uses: stefanzweifel/[email protected]
+ with:
+ commit_message: Write locks and update checksums
+ branch: ${{ github.head_ref }}
Review Comment:
Thanks for the insights, I was not aware of these regulations, but it was
definitely a topic for discussion.
I believe it is possible to achieve the same result without third-party
actions and allow github actions to create the commits (if that is ok?). I will
try and test it on a mirrored repository. :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]