From 2ecbd75d64a6f48a8baaf61145d684ff880ea986 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Sat, 21 Jun 2025 18:20:04 +0100 Subject: [PATCH] ci: fixes - Install UV - Verbose run - Set permissions explicitly - Check all files --- .editorconfig | 2 +- .forgejo/actions/prefligit/action.yml | 11 ++++++++--- .forgejo/workflows/prefligit-checks.yml | 9 ++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 17bb0c17..3e7fd1b8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,6 +23,6 @@ indent_size = 2 indent_style = tab max_line_length = 98 -[{**/*.yml}] +[*.yml] indent_size = 2 indent_style = space diff --git a/.forgejo/actions/prefligit/action.yml b/.forgejo/actions/prefligit/action.yml index 10f47af9..8cbd4500 100644 --- a/.forgejo/actions/prefligit/action.yml +++ b/.forgejo/actions/prefligit/action.yml @@ -1,6 +1,6 @@ -name: reflighit +name: prefligit description: | - Runs reflighit, pre-commit reimplemented in Rust. + Runs prefligit, pre-commit reimplemented in Rust. inputs: extra_args: description: options to pass to pre-commit run @@ -10,6 +10,11 @@ inputs: runs: using: composite steps: + - name: Install uv + uses: https://github.com/astral-sh/setup-uv@v6 + with: + enable-cache: true + ignore-nothing-to-cache: true - name: Install Prefligit shell: bash run: | @@ -18,5 +23,5 @@ runs: with: path: ~/.cache/prefligit key: prefligit-0|${{ hashFiles('.pre-commit-config.yaml') }} - - run: prefligit run --show-diff-on-failure --color=always ${{ inputs.extra_args }} + - run: prefligit run --show-diff-on-failure --color=always -v ${{ inputs.extra_args }} shell: bash diff --git a/.forgejo/workflows/prefligit-checks.yml b/.forgejo/workflows/prefligit-checks.yml index 8eae8451..cc512496 100644 --- a/.forgejo/workflows/prefligit-checks.yml +++ b/.forgejo/workflows/prefligit-checks.yml @@ -2,6 +2,9 @@ name: Checks / Prefligit on: push: + pull_request: +permissions: + contents: read jobs: prefligit: @@ -10,6 +13,10 @@ jobs: FROM_REF: ${{ github.event.pull_request.base.sha || (!github.event.forced && ( github.event.before != '0000000000000000000000000000000000000000' && github.event.before || github.sha )) || format('{0}~', github.sha) }} TO_REF: ${{ github.sha }} steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false - uses: ./.forgejo/actions/prefligit with: - extra_args: --from-ref ${{ env.FROM_REF }} --to-ref ${{ env.TO_REF }} --hook-stage manual + extra_args: --all-files --hook-stage manual