From 541bfe44c704d470b098c4e273facb97b760648b Mon Sep 17 00:00:00 2001 From: Parth Iyer Date: Thu, 2 Apr 2026 19:35:35 -0400 Subject: [PATCH 1/2] Add comment when linting fails --- .github/workflows/check.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index aec440c6..02286131 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,6 +12,7 @@ jobs: permissions: actions: read contents: read + pull-requests: write security-events: write steps: @@ -33,8 +34,21 @@ jobs: run: ./gradlew build - name: Lint - run: | - ./gradlew lint || echo "::warning::Checkstyle found violations. See the checkstyle-report artifact for details." + id: lint + continue-on-error: true + run: ./gradlew lint + + - name: Comment on PR if lint failed + if: steps.lint.outcome == 'failure' && github.event_name == 'pull_request' + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: ':warning: **Checkstyle found style violations.** See the **checkstyle-report** artifact for details.' + }) - name: Determine artifact name id: find_artifact From f0ce65fe1542e5371a9d680fe066c5afffd03899 Mon Sep 17 00:00:00 2001 From: Parth Iyer Date: Thu, 2 Apr 2026 19:42:19 -0400 Subject: [PATCH 2/2] introduced fail --- src/main/java/tanks/Game.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/tanks/Game.java b/src/main/java/tanks/Game.java index 1f692492..4f57bd0f 100644 --- a/src/main/java/tanks/Game.java +++ b/src/main/java/tanks/Game.java @@ -321,8 +321,7 @@ public int hashCode() // Value is set before Game.game.window is initialized public boolean fullscreen = false; - private Game() - { + private Game() { Game.game = this; input = new InputBindings(); }