From 6beecb0dc8854ae2ed79da4a2be6e8bd895349e0 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:37:26 +0800 Subject: chore: update pre-commit configuration and remove unnecessary dependencies Modified the .pre-commit-config.yaml to include additional hooks and reorganized the repository structure. Updated pyproject.toml to remove the pre-commit dependency, streamlining the project configuration. --- .github/workflows/prek.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/prek.yml (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml new file mode 100644 index 0000000..094ebf9 --- /dev/null +++ b/.github/workflows/prek.yml @@ -0,0 +1,22 @@ +name: Prek Checks + +on: + push: + branches: ["main", "dev"] + pull_request: + branches: ["main", "dev"] + workflow_dispatch: + +permissions: + contents: read + +jobs: + prek: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run prek + uses: j178/prek-action@v1 + with: + all_files: ${{ github.event_name == 'pull_request' }} -- cgit v1.2.3-70-g09d2 From 15439e41644a17b4ef889e78474025d54ac4b6c7 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:48:14 +0800 Subject: chore: enhance prek workflow to support auto-fixing and commit changes Updated the GitHub Actions workflow to enable automatic fixes for issues detected by the prek action. Added a conditional step to commit changes made by prek, improving the CI process by ensuring that fixes are applied directly to the repository. --- .github/workflows/prek.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index 094ebf9..88c9be3 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -3,20 +3,35 @@ name: Prek Checks on: push: branches: ["main", "dev"] - pull_request: - branches: ["main", "dev"] workflow_dispatch: permissions: - contents: read + contents: write jobs: prek: runs-on: ubuntu-latest + # Skip if commit message contains [skip ci] (to avoid loops with pre-commit.ci) + if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 - - name: Run prek + - name: Run prek (auto-fix) + id: prek uses: j178/prek-action@v1 + continue-on-error: true + with: + all_files: true + + - name: Commit fixes + if: steps.prek.outcome == 'failure' + uses: stefanzweifel/git-auto-commit-action@v5 with: - all_files: ${{ github.event_name == 'pull_request' }} + commit_message: "chore: apply prek auto-fixes [skip ci]" + commit_user_name: "pre-commit bot" + commit_user_email: "pre-commit-bot@users.noreply.github.com" + skip_dirty_check: true -- cgit v1.2.3-70-g09d2 From 521ca11bdb97523b08fa255be015cd9da19f8895 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:50:59 +0800 Subject: chore: update prek workflow bot user details Changed the commit user name and email for the prek auto-fix action in the GitHub Actions workflow to reflect the new bot identity, enhancing clarity in commit history. --- .github/workflows/prek.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index 88c9be3..cc3b4f9 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -32,6 +32,6 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "chore: apply prek auto-fixes [skip ci]" - commit_user_name: "pre-commit bot" - commit_user_email: "pre-commit-bot@users.noreply.github.com" + commit_user_name: "hydroroll-bot" + commit_user_email: "bot@hydroroll.team" skip_dirty_check: true -- cgit v1.2.3-70-g09d2 From d5a00cca455c6274deeb6bfdd62a6493b41699cb Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 15:53:50 +0800 Subject: chore: enhance prek workflow with Rust installation and system dependencies Added steps to the GitHub Actions workflow for installing Rust and necessary system dependencies on Linux, improving the environment setup for the prek auto-fix action. --- .github/workflows/prek.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index cc3b4f9..f002c8a 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -20,6 +20,22 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install system dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update || true + sudo apt-get install -y \ + libwebkit2gtk-4.1-dev \ + build-essential \ + libssl-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + pkg-config + - name: Run prek (auto-fix) id: prek uses: j178/prek-action@v1 -- cgit v1.2.3-70-g09d2 From b2f5c7b40a2e372f185b5818901a4234a61527c8 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 16:02:45 +0800 Subject: chore: refine prek workflow by removing skip ci comment Removed the commented line that instructed to skip the CI process based on commit messages, streamlining the workflow configuration for clarity and maintainability. --- .github/workflows/prek.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index f002c8a..b49447d 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -11,7 +11,6 @@ permissions: jobs: prek: runs-on: ubuntu-latest - # Skip if commit message contains [skip ci] (to avoid loops with pre-commit.ci) if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout code @@ -42,7 +41,7 @@ jobs: continue-on-error: true with: all_files: true - + - name: Commit fixes if: steps.prek.outcome == 'failure' uses: stefanzweifel/git-auto-commit-action@v5 -- cgit v1.2.3-70-g09d2 From 756c60e51967189c6e37166011927bbe219c0352 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:33:49 +0800 Subject: chore: enhance GitHub Actions workflow to check for changes before committing fixes Updated the GitHub Actions workflow to include a step that checks for changes before committing auto-fixes. This ensures that commits are only made when there are actual changes, improving the efficiency of the workflow. --- .github/workflows/prek.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index b49447d..4312e97 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -42,8 +42,18 @@ jobs: with: all_files: true - - name: Commit fixes + - name: Check for changes + id: check_changes if: steps.prek.outcome == 'failure' + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "has_changes=true" >> $GITHUB_OUTPUT + else + echo "has_changes=false" >> $GITHUB_OUTPUT + fi + + - name: Commit fixes + if: steps.prek.outcome == 'failure' && steps.check_changes.outputs.has_changes == 'true' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "chore: apply prek auto-fixes [skip ci]" -- cgit v1.2.3-70-g09d2 From 122beeee28a8e07caaa88634d3f09cfc53f55a61 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 16 Jan 2026 20:35:50 +0800 Subject: chore: simplify GitHub Actions workflow by removing unnecessary auto-fix option Updated the GitHub Actions workflow to remove the 'all_files' option from the prek action, streamlining the process and ensuring that the action runs without additional parameters. This change enhances clarity and maintains the workflow's efficiency. --- .github/workflows/prek.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '.github/workflows/prek.yml') diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml index 4312e97..8e43763 100644 --- a/.github/workflows/prek.yml +++ b/.github/workflows/prek.yml @@ -35,12 +35,10 @@ jobs: librsvg2-dev \ pkg-config - - name: Run prek (auto-fix) + - name: Run prek id: prek uses: j178/prek-action@v1 continue-on-error: true - with: - all_files: true - name: Check for changes id: check_changes -- cgit v1.2.3-70-g09d2