Use common linter workflow

This commit is contained in:
Erwan MATHIEU 2024-12-17 16:21:42 +01:00
parent e11d0db61a
commit f95d073b1b

View File

@ -1,34 +1,19 @@
name: printer-linter-format name: printer-linter-format
on: on:
push: push:
paths: paths:
- 'resources/definitions/**' - 'resources/definitions/**'
- 'resources/extruders/**' - 'resources/extruders/**'
- 'resources/intent/**' - 'resources/intent/**'
- 'resources/quality/**' - 'resources/quality/**'
- 'resources/variants/**' - 'resources/variants/**'
jobs: jobs:
printer-linter-format: printer-linter-format:
name: Printer linter auto format name: Printer linter auto format
uses: ultimaker/cura-workflows/.github/workflows/lint-formatter.yml@main
runs-on: ubuntu-latest with:
steps: file_patterns: resources/+(definitions|extruders)/*.def.json resources/+(intent|quality|variants)/**/*.inst.cfg
- name: Setup the build environment command: python printer-linter/src/terminal.py --format
uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@main commit_message: "Apply printer-linter format"
- uses: greguintow/get-diff-action@v7
with:
PATTERNS: |
resources/+(definitions|extruders)/*.def.json
resources/+(intent|quality|variants)/**/*.inst.cfg
- name: Format file
if: env.GIT_DIFF && !env.MATCHED_FILES
run: python printer-linter/src/terminal.py --format ${{ env.GIT_DIFF_FILTERED }}
- uses: stefanzweifel/git-auto-commit-action@v4
if: env.GIT_DIFF && !env.MATCHED_FILES
with:
commit_message: "Applied printer-linter format"