Add shared python-lint composite action using uvx ruff

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-09 13:49:13 -05:00
parent dac7a1704a
commit 4586c7dcb3

38
python-lint/action.yml Normal file
View File

@ -0,0 +1,38 @@
# Python Lint
# Runs ruff check via uvx (no pip install needed)
# Bootstraps uv if not already available on the runner
name: Python Lint
description: Run ruff check on Python source code using uvx
inputs:
src:
description: Source directory or file to check
default: '.'
ruff-version:
description: Ruff version to use (e.g., 0.9.x)
default: ''
extra-args:
description: Additional arguments to pass to ruff check
default: ''
runs:
using: composite
steps:
- name: Ensure uv is available
shell: bash
run: |
if ! command -v uv &>/dev/null; then
echo "uv not found, installing..."
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
- name: Run ruff check
shell: bash
run: |
RUFF_SPEC="ruff"
if [ -n "${{ inputs.ruff-version }}" ]; then
RUFF_SPEC="ruff@${{ inputs.ruff-version }}"
fi
uvx $RUFF_SPEC check ${{ inputs.extra-args }} ${{ inputs.src }}