Skip to content

Commit 6b730bf

Browse files
committed
ci: update pr format rule
1 parent bd8ca2a commit 6b730bf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/pr-format.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ on:
77
- synchronize
88
- reopened
99
- ready_for_review
10+
push:
11+
branches:
12+
- master
13+
paths:
14+
- "**/*.java"
1015

1116
permissions:
1217
contents: write
1318

1419
jobs:
1520
format:
16-
if: github.event.pull_request.head.repo.full_name == github.repository
21+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
1722
runs-on: ubuntu-latest
1823

1924
steps:
20-
- name: Checkout PR branch
25+
- name: Checkout branch
2126
uses: actions/checkout@v4
2227
with:
23-
ref: ${{ github.event.pull_request.head.ref }}
28+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
2429
fetch-depth: 0
2530

2631
- name: Set up Java 21

0 commit comments

Comments
 (0)