Skip to content

Commit b65ef07

Browse files
authored
ci(java): suggest formatting fixes (#797)
GitHub action config to run the java formatter and suggest inline fixes on the pull request. This was tested in java-asset: [example PR](googleapis/java-asset#392).
1 parent 9b7fadc commit b65ef07

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
pull_request_target:
3+
types: [opened, synchronize]
4+
branches:
5+
- master
6+
name: format
7+
jobs:
8+
format-code:
9+
runs-on: ubuntu-latest
10+
env:
11+
ACCESS_TOKEN: {{ '${{ secrets.YOSHI_CODE_BOT_TOKEN }}' }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
ref: {{ '${{github.event.pull_request.head.ref}}' }}
16+
repository: {{ '${{github.event.pull_request.head.repo.full_name}}' }}
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
- run: "mvn com.coveo:fmt-maven-plugin:format"
21+
- uses: googleapis/[email protected]
22+
with:
23+
command: review
24+
pull_number: {{ '${{ github.event.pull_request.number }}' }}
25+
git_dir: '.'

0 commit comments

Comments
 (0)