Skip to content

Commit 213ff6e

Browse files
committed
chore: Sync with WeblateOrg/meta
1 parent f022125 commit 213ff6e

File tree

4 files changed

+65
-12
lines changed

4 files changed

+65
-12
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright © Michal Čihař <[email protected]>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# This file is maintained in https://github.com/WeblateOrg/meta/
6+
name: Dependency Review
7+
on:
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
dependency-review:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
with:
20+
persist-credentials: false
21+
- name: Dependency Review
22+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ jobs:
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424
with:
2525
persist-credentials: false
26+
- name: Get cache tag
27+
id: get-date
28+
run: |
29+
echo "cache_tag=$(/bin/date --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
30+
echo "previous_cache_tag=$(/bin/date --date='1 month ago' --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
31+
shell: bash
2632
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
33+
id: pre-commit-cache
2734
with:
2835
path: ~/.cache/pre-commit
29-
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
36+
key: ${{ runner.os }}-pre-commit-${{ steps.get-date.outputs.cache_tag }}-${{ hashFiles('.pre-commit-config.yaml') }}
37+
restore-keys: |
38+
${{ runner.os }}-pre-commit-${{ steps.get-date.outputs.cache_tag }}
39+
${{ runner.os }}-pre-commit-${{ steps.get-date.outputs.previous_cache_tag }}
40+
${{ runner.os }}-pre-commit-
3041
- name: Setup Python
3142
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3243
with:
@@ -46,13 +57,17 @@ jobs:
4657
fi
4758
- name: pre-commit (PEP 735)
4859
if: steps.detect.outputs.method == 'pep735'
49-
run: uv run --only-group pre-commit pre-commit run --all --show-diff-on-failure
60+
run: |
61+
uv run --only-group pre-commit pre-commit run --all --show-diff-on-failure
62+
uv run --only-group pre-commit pre-commit gc
5063
env:
5164
RUFF_OUTPUT_FORMAT: github
5265
REUSE_OUTPUT_FORMAT: github
5366
- name: pre-commit (uvx)
5467
if: steps.detect.outputs.method == 'uvx'
55-
run: uvx pre-commit run --all --show-diff-on-failure
68+
run: |
69+
uvx pre-commit run --all --show-diff-on-failure
70+
uvx pre-commit gc
5671
env:
5772
RUFF_OUTPUT_FORMAT: github
5873
REUSE_OUTPUT_FORMAT: github
@@ -64,7 +79,9 @@ jobs:
6479
run: uv pip install --system "$(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)"
6580
- name: pre-commit (installed)
6681
if: steps.detect.outputs.method == 'requirements' || steps.detect.outputs.method == 'pyproject'
67-
run: pre-commit run --all --show-diff-on-failure
82+
run: |
83+
pre-commit run --all --show-diff-on-failure
84+
pre-commit gc
6885
env:
6986
RUFF_OUTPUT_FORMAT: github
7087
REUSE_OUTPUT_FORMAT: github

.github/workflows/pull_requests.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ permissions:
1515

1616
jobs:
1717
weblate_automerge:
18-
permissions:
19-
pull-requests: write
20-
contents: write
2118
runs-on: ubuntu-24.04
2219
name: Weblate automerge
2320
if: github.actor == 'weblate'

.pre-commit-config.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ repos:
3434
- id: mdformat
3535
additional_dependencies:
3636
- mdformat-gfm==0.4.1
37-
- mdformat-ruff==0.1.3
3837
- mdformat-shfmt==0.2.0
3938
- mdformat_tables==1.0.0
4039
- repo: https://github.com/igorshubovych/markdownlint-cli
@@ -50,13 +49,31 @@ repos:
5049
rev: v1.7.7
5150
hooks:
5251
- id: actionlint
53-
- repo: https://github.com/adamchainz/blacken-docs
54-
rev: 1.19.1
55-
hooks:
56-
- id: blacken-docs
5752
- repo: https://github.com/zizmorcore/zizmor-pre-commit
5853
rev: v1.11.0
5954
hooks:
6055
- id: zizmor
56+
- repo: https://github.com/scop/pre-commit-shfmt
57+
rev: v3.12.0-1
58+
hooks:
59+
- id: shfmt
60+
args: [--write]
61+
- repo: https://github.com/shellcheck-py/shellcheck-py
62+
rev: v0.10.0.1
63+
hooks:
64+
- id: shellcheck
65+
require_serial: true
66+
- repo: https://github.com/gitleaks/gitleaks
67+
rev: v8.27.2
68+
hooks:
69+
- id: gitleaks-docker
70+
- repo: https://github.com/astral-sh/ruff-pre-commit
71+
rev: v0.12.3
72+
hooks:
73+
- id: ruff-check
74+
args:
75+
- --fix
76+
- --exit-non-zero-on-fix
77+
- id: ruff-format
6178
ci:
6279
autoupdate_schedule: quarterly

0 commit comments

Comments
 (0)