Skip to content

Commit

Permalink
Merge pull request #11291 from camptocamp/project-pre-commit-ci
Browse files Browse the repository at this point in the history
Add pre-commit in the project CI
  • Loading branch information
sbrunner authored Aug 8, 2024
2 parents 4b97403 + 172fcf0 commit 705caba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ jobs:
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{'{{'}} hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{'{{'}} hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()

# Can be used to have some secrets (with mask)
# - run: make secrets
# - run: cat env.secrets |grep '^[# A-Z0-9_]\+='|sed -e 's/^[# A-Z0-9_]\+=\(.*\)/::add-mask::\1/g'
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
c2cciutils[checks,publish]==1.6.22
pre-commit==3.8.0

0 comments on commit 705caba

Please sign in to comment.