From d4f25db6471f7fc6355984c4e758f5b279f2481d Mon Sep 17 00:00:00 2001 From: Ludy Date: Sun, 22 Dec 2024 17:36:46 +0100 Subject: [PATCH] used pre-commit/action (#2548) # Description Please provide a summary of the changes, including relevant motivation and context. Closes #(issue_number) ## Checklist - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have performed a self-review of my own code - [ ] I have attached images of the change if it is UI based - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] If my code has heavily changed functionality I have updated relevant docs on [Stirling-PDFs doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) - [ ] My changes generate no new warnings - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) --- .github/workflows/pre_commit.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml index 46e90074..842257d7 100644 --- a/.github/workflows/pre_commit.yml +++ b/.github/workflows/pre_commit.yml @@ -16,20 +16,21 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + uses: actions/setup-python@v5 with: python-version: 3.12 + - name: Run Pre-Commit Hooks + uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + continue-on-error: true - name: Set up git config run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Install Dependencies + - name: git add run: | - pip install pre-commit==4.0.1 - - name: Run pre-commit and git add - run: | - pre-commit run -c .pre-commit-config.yaml || true git add . git diff --staged --quiet || git commit -m ":file_folder: pre-commit > Made via .github/workflows/pre_commit.yml" || echo "pre-commit: no changes" @@ -37,12 +38,12 @@ jobs: uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update files + commit-message: "ci: 🤖 format everything with pre-commit" committer: GitHub Action author: GitHub Action signoff: true branch: pre-commit - title: "🔨 [pre-commit] Update files by " + title: "🤖 format everything with pre-commit by " body: | Auto-generated by [create-pull-request][1]