feat: added functionality for custom formatting command as argumet

This commit is contained in:
Ceferino Patino 2025-03-01 10:02:32 -06:00
commit e358ab7b5d
Signed by: c4patino
SSH key fingerprint: SHA256:9fQ9TsujGrdNNi76mnsu63v7dS5JOmHRZEqBOl49OR8
2 changed files with 12 additions and 0 deletions

View file

@ -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 || '.' }}"

View file

@ -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 || '.' }}"