diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a4a6bff..4875842 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,5 +9,10 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Check formatting + - name: Check formatting latest uses: ./ + + - name: Check formatting specific version + uses: ./ + with: + dprint-version: 0.17.0 diff --git a/README.md b/README.md index 377ea8f..e282f3e 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,19 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: dprint/check@v1.6 + - uses: dprint/check@v2.0 +``` + +### Latest Version + +By default, `dprint/check` uses the latest version of dprint. + +### Specific Version + +To use a specific version, specify that with the `dprint-version` input: + +```yml +- uses: dprint/check@v2.0 + with: + dprint-version: "0.17.0" ``` diff --git a/action.yml b/action.yml index bfc7684..40b109b 100644 --- a/action.yml +++ b/action.yml @@ -2,13 +2,18 @@ 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.17.0)' + required: false + default: '' runs: using: 'composite' steps: - name: Install dprint shell: bash run: | - curl -fsSL https://dprint.dev/install.sh | sh -s 0.17.0 > /dev/null 2>&1 + 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 diff --git a/dprint.json b/dprint.json index 0497b09..ff0abee 100644 --- a/dprint.json +++ b/dprint.json @@ -1,5 +1,4 @@ { - "$schema": "https://dprint.dev/schemas/v0.json", "incremental": true, "includes": ["**/*.{md,json}"], "plugins": [