feat: added functionality for custom formatting command as argumet
This commit is contained in:
parent
6f6b116a9f
commit
e358ab7b5d
2 changed files with 12 additions and 0 deletions
4
.github/workflows/format-nix.yml
vendored
4
.github/workflows/format-nix.yml
vendored
|
|
@ -25,7 +25,11 @@ jobs:
|
|||
uses: nicknovitski/nix-develop@v1.2.0
|
||||
with:
|
||||
arguments: "github:c4patino/nixos-config#${{ inputs.shell }}"
|
||||
- name: run formatting command
|
||||
if: inputs.command != ''
|
||||
run: ${{ inputs.command }}
|
||||
- name: format all files
|
||||
if: inputs.command == ''
|
||||
run: |
|
||||
TARGET_DIR="${{ inputs.directory || '.' }}"
|
||||
|
||||
|
|
|
|||
8
.github/workflows/format.yml
vendored
8
.github/workflows/format.yml
vendored
|
|
@ -11,6 +11,10 @@ on:
|
|||
description: "the directory to format (default: .)"
|
||||
required: false
|
||||
type: string
|
||||
command:
|
||||
description: custom command to run for formatting
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
format:
|
||||
|
|
@ -45,7 +49,11 @@ jobs:
|
|||
- name: set up rust
|
||||
if: inputs.language == 'rust'
|
||||
uses: c4patino/actions/.github/actions/setup-rust@main
|
||||
- name: run formatting command
|
||||
if: inputs.command != ''
|
||||
run: ${{ inputs.command }}
|
||||
- name: format all files
|
||||
if: inputs.command == ''
|
||||
run: |
|
||||
TARGET_DIR="${{ inputs.directory || '.' }}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue