diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index c16e502..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Code Formatting - -on: - push: - branches-ignore: - - main - pull_request: - types: - - opened - - ready_for_review - - reopened - -jobs: - ci: - runs-on: 'ubuntu-latest' - name: PR Formatter - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Install python - uses: actions/setup-python@v3 - with: - python-version: '3.9' - - - name: Format the code - uses: psf/black@stable - with: - options: "--check --diff" - src: "." - - - name: Check-in updated code - uses: EndBug/add-and-commit@v9 - with: - default_author: github_actions - committer_name: GitHub Actions - committer_email: actions@github.com - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..4ab5d8a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,42 @@ +name: Trunk Code Quality + +on: + push: + branches-ignore: + - main + pull_request: + types: + - opened + - ready_for_review + - reopened + +jobs: + trunk-quality: + runs-on: ubuntu-latest + permissions: + checks: write + contents: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install Trunk + uses: trunk-io/trunk-action/setup@v1 + + - name: Run Trunk Autofix + run: trunk fmt . + + - name: Trunk Code Review & Lint + uses: trunk-io/trunk-action@v1 + + # Optionally commit autofixes + - name: Commit changes + if: success() + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + committer_name: GitHub Actions + committer_email: actions@github.com + message: 'Apply Trunk autofixes' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}