-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
35 lines (35 loc) · 1.08 KB
/
action.yml
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
name: 'dprint-check-action'
description: 'Run `dprint check` on your source code'
author: 'thomaseizinger'
inputs:
dprint-version:
description: 'Specific dprint version to use (ex. 0.30.3)'
required: false
default: ''
config-path:
description: 'Specific dprint config to use (ex. dprint.json)'
required: false
default: ''
args:
description: 'Additional arguments to pass to dprint check'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Install dprint
shell: bash
run: |
curl -fsSL https://dprint.dev/install.sh | sh -s ${{ inputs.dprint-version }} > /dev/null 2>&1
echo "/home/runner/.dprint/bin" >> $GITHUB_PATH
- name: Check formatting
shell: bash
if: "${{ inputs.config-path == '' }}"
run: ~/.dprint/bin/dprint check ${{ inputs.args }}
- name: Check formatting with config
shell: bash
if: "${{ inputs.config-path != '' }}"
run: ~/.dprint/bin/dprint check --config '${{ inputs.config-path }}' ${{ inputs.args }}
branding:
icon: 'check-circle'
color: 'gray-dark'