Skip to content

Commit 89cb276

Browse files
committed
Fix CICD
1 parent 70d00bd commit 89cb276

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ jobs:
3030
steps:
3131
- name: Checkout Repository
3232
uses: actions/checkout@v4
33-
3433
- name: Apply patch to gradle.properties
3534
run: sed -i 's/debug_all = false/debug_all = true/g' gradle.properties
3635

3736
- name: Setup Build
3837
uses: ./.github/actions/build_setup
3938

4039
- name: Compile the mod
41-
run: ./gradlew --info --scan assemble
40+
run: ./gradlew --info --scan --stacktrace assemble
4241

4342
- name: Upload Jars
4443
uses: actions/upload-artifact@v4

.github/workflows/format_java.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,22 @@ jobs:
3131
- name: Setup Build
3232
uses: ./.github/actions/build_setup
3333

34+
- name: Check if PR is from a fork
35+
id: fork-check
36+
run: |
37+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
38+
echo "is_fork=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "is_fork=false" >> $GITHUB_OUTPUT
41+
fi
42+
shell: bash
43+
3444
- name: Run Spotless Formatting Check with Gradle
3545
id: build
36-
run: ./gradlew --info spotlessCheck
46+
run: ./gradlew --info --stacktrace spotlessCheck
3747

3848
- name: Attempt to make a PR fixing spotless errors
39-
if: failure() && steps.build.conclusion == 'failure'
49+
if: failure() && steps.build.conclusion == 'failure' && steps.fork-check.outputs.is_fork == 'false'
4050
run: |
4151
git reset --hard
4252
git checkout "${PR_BRANCH}"
@@ -54,9 +64,16 @@ jobs:
5464
--body "Automatic spotless apply to fix formatting errors, applies to PR #${PR_NUMBER}" \
5565
2>&1 | tee pr-message.log || true
5666
gh pr comment "${PR_BRANCH}" -F pr-message.log || true
57-
shell: bash # ensures set -eo pipefail
67+
shell: bash
5868
env:
5969
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6070
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
6171
PR_NUMBER: ${{ github.event.pull_request.number }}
6272
FIXED_BRANCH: ${{ github.head_ref }}-spotless-fixes
73+
74+
- name: Comment to PR if from fork and formatting failed
75+
if: failure() && steps.build.conclusion == 'failure' && steps.fork-check.outputs.is_fork == 'true'
76+
run: |
77+
gh pr comment ${{ github.event.pull_request.number }} --body "I can't get automatic fixes by spotless in CI. Please run '. /gradlew spotlessApply' and push again."
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
uses: ./.github/actions/build_setup
3030

3131
- name: Run Tests with Gradle
32-
run: ./gradlew --info --scan test
32+
run: ./gradlew --info --scan --stacktrace test

.github/workflows/update_buildscript.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: ./.github/actions/build_setup
2626

2727
- name: Run Buildscript Updater
28-
run: ./gradlew --info updateBuildScript
28+
run: ./gradlew --info --stacktrace updateBuildScript
2929

3030
- name: Get New Buildscript Version
3131
id: version-check

.github/workflows/update_gradle_cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
update-cache: true
2828

2929
- name: Build Project with Gradle
30-
run: ./gradlew --info assemble
30+
run: ./gradlew --info --stacktrace assemble

0 commit comments

Comments
 (0)