Skip to content

Commit

Permalink
ci: Add args
Browse files Browse the repository at this point in the history
Adds `args` input to allow for passing arbitrary additional arguments to
`dprint check`

**Alternatives**

Add specific inputs for the things that I need:

- `files`
- `--excludes`
  • Loading branch information
znd4 committed Sep 22, 2024
1 parent 2f1cf31 commit 5e05472
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ jobs:
with:
dprint-version: 0.30.3
config-path: 'dprint.json'
- name: make poorly-formatted json file
run: |
echo '{"a": 1, "b": 2}' > poorly-formatted.json
- name: Check formatting with excludes
uses: ./
with:
args: --excludes poorly-formatted.json



8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
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:
Expand All @@ -21,11 +25,11 @@ runs:
- name: Check formatting
shell: bash
if: "${{ inputs.config-path == '' }}"
run: ~/.dprint/bin/dprint check
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 }}'
run: ~/.dprint/bin/dprint check --config '${{ inputs.config-path }}' ${{ inputs.args }}
branding:
icon: 'check-circle'
color: 'gray-dark'

0 comments on commit 5e05472

Please sign in to comment.