forked from ITensor/ITensorActions
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 1.78 KB
/
Copy pathFormatSuggest.yml
File metadata and controls
62 lines (57 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "Reusable Format PR Workflow"
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"
required: false
type: string
concurrent-jobs:
description: "Run jobs concurrently"
default: false
required: false
type: boolean
cancel-in-progress:
description: "Cancel jobs in-progress in favor of a new one in the same concurrency group"
default: true
required: false
type: boolean
jobs:
check-formatting:
name: "Check Formatting"
uses: "JuliaActions/workflows/FormatCheck.yml@main"
with:
directory: "${{ inputs.directory }}"
julia-version: "${{ inputs.julia-version }}"
juliaformatter-version: "${{ inputs.juliaformatter-version }}"
concurrent-jobs: "${{ inputs.concurrent-jobs }}"
cancel-in-progress: "${{ inputs.cancel-in-progress }}"
comment-formatting-suggestions:
name: "Comment Formatting Suggestions on PR"
needs: check-formatting
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Apply formatting changes"
run: |
echo "$(cat <<'END_FORMATTING_DIFF'
${{ needs.check-formatting.outputs.format-diff-patch }}
END_FORMATTING_DIFF
)" | git apply
- uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter
fail_on_error: true
filter_mode: added