Skip to content

Commit 4ed4804

Browse files
committed
refactor: simplify pre-commit workflow by removing matrix strategy and PR comments
1 parent 26fc62b commit 4ed4804

File tree

1 file changed

+3
-46
lines changed

1 file changed

+3
-46
lines changed

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
pre-commit-checks:
11-
name: Pre-commit Checks (JDK ${{ matrix.java-version }})
11+
name: Pre-commit Checks
1212
runs-on: ubuntu-latest
1313

1414
permissions:
@@ -31,21 +31,6 @@ jobs:
3131

3232
- name: Setup Gradle
3333
uses: gradle/actions/setup-gradle@v5
34-
with:
35-
build-scan-publish: true
36-
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
37-
build-scan-terms-of-use-agree: "yes"
38-
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}
39-
40-
- name: Cache pre-commit environments
41-
uses: actions/cache@v4
42-
with:
43-
path: |
44-
~/.cache/pre-commit
45-
~/.local/share/pre-commit
46-
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-${{ runner.os }}
47-
restore-keys: |
48-
pre-commit-${{ runner.os }}
4934

5035
- name: Set up Python
5136
uses: actions/setup-python@v5
@@ -55,35 +40,7 @@ jobs:
5540
- name: Install pre-commit
5641
run: pip install pre-commit
5742

58-
- name: Make gradlew executable
59-
run: chmod +x ./gradlew
60-
6143
- name: Run pre-commit hooks
62-
id: precommit
63-
continue-on-error: false
6444
run: |
65-
set -e # Exit immediately on error
66-
echo "Running pre-commit checks..."
67-
pre-commit run --all-files --show-diff-on-failure --color=always --verbose
68-
69-
- name: Comment on PR with results
70-
if: github.event_name == 'pull_request' && always()
71-
uses: actions/github-script@v7
72-
with:
73-
script: |
74-
const result = '${{ steps.precommit.outcome }}';
75-
if (result === 'failure') {
76-
github.rest.issues.createComment({
77-
issue_number: context.issue.number,
78-
owner: context.repo.owner,
79-
repo: context.repo.repo,
80-
body: `❌ Pre-commit checks failed for JDK 25. Please check the workflow run for details.`
81-
});
82-
} else if (result === 'success') {
83-
github.rest.issues.createComment({
84-
issue_number: context.issue.number,
85-
owner: context.repo.owner,
86-
repo: context.repo.repo,
87-
body: `✅ Pre-commit checks passed!`
88-
});
89-
}
45+
chmod +x ./gradlew
46+
pre-commit run --all-files --show-diff-on-failure --color always

0 commit comments

Comments
 (0)