Repository navigation
chore(governance): centralize PR gate and anti-leak hygiene #187
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Engineering governance | |
| on: | |
| pull_request: | |
| push: | |
| branches: ["main"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| gitleaks: | |
| name: Gitleaks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Scan added commits with redacted findings | |
| uses: Pigbibi/PrGovernance/pr-governance@ccda8de572d2893272b0137526ef3e2d45e5eee7 | |
| with: | |
| mode: scan | |
| commitlint: | |
| name: Commit message convention | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Validate pull request commit messages | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| env: | |
| PR_BASE: ${{ github.event.pull_request.base.sha }} | |
| PR_HEAD: ${{ github.event.pull_request.head.sha }} | |
| run: | | |
| set -euo pipefail | |
| tool="$RUNNER_TEMP/governance-commitlint" | |
| npm install --prefix "$tool" --ignore-scripts --no-audit --no-fund \ | |
| @commitlint/cli@21.2.4 @commitlint/config-conventional@21.2.4 | |
| printf '%s\n' "module.exports = {extends: [require.resolve('@commitlint/config-conventional')], defaultIgnores: true, ignores: [(message) => /^Merge /.test(message)], rules: {'subject-case': [0], 'header-max-length': [2, 'always', 72], 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'refactor', 'test', 'chore', 'perf', 'ci']]}};" > "$tool/commitlint.config.cjs" | |
| node "$tool/node_modules/@commitlint/cli/cli.js" \ | |
| --config "$tool/commitlint.config.cjs" --from "$PR_BASE" --to "$PR_HEAD" --verbose |