Skip to content

Commit

Permalink
ci: run PR
Browse files Browse the repository at this point in the history
  • Loading branch information
thazhemadam committed Mar 5, 2024
1 parent bd4e59d commit f18821e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/format-pr.yml
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

0 comments on commit f18821e

Please sign in to comment.