|
| 1 | +repos: |
| 2 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 3 | + rev: v6.0.0 |
| 4 | + hooks: |
| 5 | + - id: check-merge-conflict |
| 6 | + name: Check for merge conflict strings |
| 7 | + |
| 8 | + - id: end-of-file-fixer |
| 9 | + name: Fix missing newline at the end of files |
| 10 | + |
| 11 | + - id: check-shebang-scripts-are-executable |
| 12 | + name: Check shell scripts are executable |
| 13 | + files: \.(sh)$ |
| 14 | + |
| 15 | + - id: check-yaml |
| 16 | + name: Check pipelines configuration |
| 17 | + files: ^(.github) |
| 18 | + |
| 19 | + - repo: https://github.com/pycqa/flake8 |
| 20 | + rev: "7ef0350a439c93166bc8ba89fcc3de6a9a664e6c" |
| 21 | + hooks: |
| 22 | + - id: flake8 |
| 23 | + |
| 24 | + - repo: local |
| 25 | + hooks: |
| 26 | + - id: zizmor-action |
| 27 | + name: Check action.yml |
| 28 | + entry: zizmor |
| 29 | + args: ["action.yml"] |
| 30 | + language: system |
| 31 | + files: action.yml |
| 32 | + pass_filenames: false |
| 33 | + |
| 34 | + - id: lint-githubactions |
| 35 | + name: Lint github actions |
| 36 | + entry: make |
| 37 | + args: ["actionlint"] |
| 38 | + language: system |
| 39 | + files: ^.github |
| 40 | + types_or: [yaml] |
| 41 | + pass_filenames: false |
| 42 | + |
| 43 | + - id: lint-githubaction-scripts |
| 44 | + name: Lint github action scripts |
| 45 | + entry: make |
| 46 | + args: ["shellcheck"] |
| 47 | + language: system |
| 48 | + files: ^.github/scripts |
| 49 | + types_or: [sh, shell] |
| 50 | + pass_filenames: false |
| 51 | + |
| 52 | + - id: check-commit-signing |
| 53 | + name: Check commit signing |
| 54 | + description: Ensures that commits are GPG signed |
| 55 | + entry: bash |
| 56 | + args: |
| 57 | + - -c |
| 58 | + - | |
| 59 | + if ! git config --get user.signingkey > /dev/null 2>&1; then |
| 60 | + echo "Error: Git signing key not configured." |
| 61 | + echo "Please configure your GPG signing key with:" |
| 62 | + echo " git config user.signingkey <YOUR_GPG_KEY_ID>" |
| 63 | + echo "" |
| 64 | + echo "To find your GPG key ID, run: gpg --list-secret-keys --keyid-format=long" |
| 65 | + echo "For more information, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits" |
| 66 | + exit 1 |
| 67 | + fi |
| 68 | + if ! git config --get commit.gpgsign | grep -q "true" > /dev/null 2>&1; then |
| 69 | + echo "Error: Commit signing is not enabled." |
| 70 | + echo "Please enable commit signing with:" |
| 71 | + echo " git config commit.gpgsign true" |
| 72 | + echo "" |
| 73 | + echo "For more information, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits" |
| 74 | + exit 1 |
| 75 | + fi |
| 76 | + echo "Commit signing is properly configured." |
| 77 | + language: system |
| 78 | + pass_filenames: false |
| 79 | + always_run: true |
| 80 | + |
| 81 | + - id: git-secrets |
| 82 | + name: Git Secrets |
| 83 | + description: git-secrets scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories. |
| 84 | + entry: bash |
| 85 | + args: |
| 86 | + - -c |
| 87 | + - "git-secrets --pre_commit_hook" |
| 88 | + language: system |
| 89 | + |
| 90 | +fail_fast: true |
| 91 | +default_stages: [pre-commit] |
0 commit comments