Skip to content

Commit 20ed57a

Browse files
committed
Fix CICD
1 parent 85da59c commit 20ed57a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
if: ${{ failure() && steps.build_mod.conclusion == 'failure' && github.event_name == 'pull_request' && !github.event.pull_request.draft }}
5959
run: |
6060
git reset --hard
61-
git checkout "${PR_BRANCH}"
61+
git checkout "${github.ref_name}"
6262
./gradlew --info spotlessApply || exit 1
6363
git diff --exit-code && exit 1
6464
git config user.name "GitHub Actions"
@@ -68,15 +68,14 @@ jobs:
6868
git push --force-with-lease origin "${FIXED_BRANCH}"
6969
gh pr create \
7070
--head "${FIXED_BRANCH}" \
71-
--base "${PR_BRANCH}" \
71+
--base "${github.ref_name}" \
7272
--title "Spotless apply for branch ${{ github.event.pull_request.head.ref }} for #${{ github.event.pull_request.number }}" \
7373
--body "Automatic spotless apply to fix formatting errors, applies to PR #${{ github.event.pull_request.number }}" \
7474
2>&1 | tee pr-message.log || true
75-
gh pr comment "${PR_BRANCH}" -F pr-message.log || true
75+
gh pr comment "${github.ref_name}" -F pr-message.log || true
7676
shell: bash # ensures set -eo pipefail
7777
env:
7878
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
PR_BRANCH: ${{ github.head_ref }}
8079
FIXED_BRANCH: ${{ github.head_ref }}-spotless-fixes
8180

8281
- name: Run server for ${{ inputs.timeout }} seconds

.github/workflows/format_java.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: ./gradlew --info spotlessCheck
3737

3838
- name: Attempt to make a PR fixing spotless errors
39-
if: failure()
39+
if: failure() && steps.build.conclusion == 'failure'
4040
run: |
4141
git reset --hard
4242
git checkout "${PR_BRANCH}"

0 commit comments

Comments
 (0)