Files
godot/.github/workflows/static_checks.yml
T
2026-02-23 10:43:23 -06:00

43 lines
1.7 KiB
YAML

name: 📊 Static Checks
on:
workflow_call:
outputs:
changed-files:
description: A list of changed files.
value: ${{ jobs.static-checks.outputs.changed-files }}
workflow_dispatch:
jobs:
static-checks:
name: Code style, file formatting, and docs
runs-on: ubuntu-24.04
timeout-minutes: 30
outputs:
changed-files: '"${{ steps.changed-files.outputs.all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Treeless clone. Slightly less performant than a shallow clone, but makes finding diffs instantaneous.
filter: tree:0 # See: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
# This needs to happen before Python and npm execution; it must happen before any extra files are written.
- name: .gitignore checks (gitignore_check.sh)
run: |
bash ./misc/scripts/gitignore_check.sh
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
safe_output: false # Output passed to environment variable to avoid command injection.
separator: '" "' # To account for paths with spaces, ensure our items are split by quotes internally.
skip_initial_fetch: true
- name: Style checks via pre-commit
uses: pre-commit/action@v3.0.1
env:
CHANGED_FILES: '"${{ steps.changed-files.outputs.all_changed_files }}"' # Wrap with quotes to bookend internal quote separators.
with:
extra_args: --files ${{ env.CHANGED_FILES }}