Skip to content

Commit

Permalink
ci(java): suggest formatting fixes (googleapis#462)
Browse files Browse the repository at this point in the history
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).

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Tue Oct 13 09:04:08 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: b65ef07d99946d23e900ef2cc490274a16edd336
Source-Link: googleapis/synthtool@b65ef07
  • Loading branch information
yoshi-automation authored and ad548 committed Mar 13, 2021
1 parent a1cf86e commit c18571b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/formatting.yaml
@@ -0,0 +1,25 @@
on:
pull_request_target:
types: [opened, synchronize]
branches:
- master
name: format
jobs:
format-code:
runs-on: ubuntu-latest
env:
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/setup-java@v1
with:
java-version: 11
- run: "mvn com.coveo:fmt-maven-plugin:format"
- uses: googleapis/code-suggester@v1.8.0
with:
command: review
pull_number: ${{ github.event.pull_request.number }}
git_dir: '.'
5 changes: 3 additions & 2 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-bigtable.git",
"sha": "f33c6746cf067378686c07ac8941b082ad7ba031"
"sha": "1fa6f62ee17fbd317cf18e68aae5dedabf2b21e3"
}
},
{
Expand All @@ -19,7 +19,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "0762e8ee2ec21cdfc4d82020b985a104feb0453b"
"sha": "b65ef07d99946d23e900ef2cc490274a16edd336"
}
}
],
Expand Down Expand Up @@ -53,6 +53,7 @@
".github/trusted-contribution.yml",
".github/workflows/auto-release.yaml",
".github/workflows/ci.yaml",
".github/workflows/formatting.yaml",
".github/workflows/samples.yaml",
".kokoro/build.bat",
".kokoro/build.sh",
Expand Down

0 comments on commit c18571b

Please sign in to comment.