feat(RELEASE-2478): convert collect-gh-params to python #3423
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: Linters | |
| 'on': | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| merge_group: | |
| types: [checks_requested] | |
| jobs: | |
| yamllint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Run yamllint | |
| uses: frenck/action-yamllint@34b4bbcaeabedcfefad6adea8c5bbc42af0e2d47 # v1 | |
| gitlint: | |
| name: Run gitlint checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.sha }} | |
| - name: Install gitlint into container | |
| run: | | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| python3 -m pip install gitlint | |
| - name: Run gitlint check | |
| run: | | |
| source venv/bin/activate | |
| RAW_BASE_REF="${{ github.base_ref || github.event.merge_group.base_ref }}" | |
| BASE_REF="${RAW_BASE_REF#refs/heads/}" | |
| echo "Base ref: $BASE_REF" | |
| git fetch origin "$BASE_REF" | |
| gitlint --commits "origin/$BASE_REF"..HEAD | |
| check-agents-md: | |
| name: Check AGENTS.md line count | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Enforce AGENTS.md max 60 lines | |
| run: | | |
| lines=$(grep -c '.' AGENTS.md) | |
| if [ "$lines" -gt 60 ]; then | |
| echo "AGENTS.md has $lines non-empty lines (max 60)" | |
| exit 1 | |
| fi | |
| check-renovate-config-file: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - uses: konflux-ci/renovate-config-validator-action@main | |
| with: | |
| config_file: .github/renovate.json | |
| check-jsonschema: | |
| name: Validate json schema file | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Setup python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: '3.12' | |
| - run: pip install check-jsonschema | |
| - name: Run json meta schema check | |
| run: check-jsonschema --check-metaschema schemas/dataKeys.json | |
| lint-jsonschema: | |
| name: Lint json schema file | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Run json schema lint | |
| run: | | |
| FILE="schemas/dataKeys.json" | |
| if ! diff -u "$FILE" <(jq . "$FILE"); then | |
| echo "Linting issue in $FILE" | |
| echo "To fix: jq . $FILE | sponge $FILE" | |
| exit 1 | |
| fi | |
| echo "$FILE is formatted correctly" |