-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd4e59d
commit f18821e
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Format PR" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
directory: | ||
description: "The directory on which JuliaFormatter needs to be run" | ||
default: "." | ||
required: false | ||
type: string | ||
julia-version: | ||
description: "Julia version" | ||
default: "1" | ||
required: false | ||
type: string | ||
juliaformatter-version: | ||
description: "Version of JuliaFormatter to use" | ||
default: "1.10" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
check-formatting: | ||
name: "Check Formatting" | ||
uses: "./.github/workflows/format-check.yml" | ||
with: | ||
directory: "${{ inputs.directory }}" | ||
julia-version: "${{ inputs.julia-version }}" | ||
juliaformatter-version: "${{ inputs.juliaformatter-version }}" | ||
fail-if-unformatted: false | ||
|
||
open-pr: | ||
needs: check-formatting | ||
if: ${{ !needs.check-formatting.outputs.formatted }} | ||
runs-on: ubuntu | ||
steps: | ||
- uses: "actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608" # v4.1.0 | ||
|
||
- run: echo "${{ needs.check-formatting.outputs.format-diff-patch }}" | git apply --quiet | ||
|
||
- uses: reviewdog/action-suggester@v1 | ||
with: | ||
github_token: ${{ secrets.DOCUMENTER_KEY }} | ||
tool_name: JuliaFormatter | ||
fail_on_error: true | ||
filter_mode: added |