File: lint.yaml

package info (click to toggle)
pyeconet 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 248 kB
  • sloc: python: 1,081; makefile: 3
file content (46 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Lint

on:
  pull_request_target:
    branches:
      - master
      - externalAPI

jobs:
  matrix:
    runs-on: ubuntu-latest
    name: Run ${{ matrix.checks }}
    strategy:
      matrix:
        checks:
          - pyupgrade
          - black
          - codespell
          - check-executables-have-shebangs
          - check-json
          - requirements-txt-fixer
          - check-ast
          - mixed-line-ending
    steps:
      - name: Check out repository
        uses: actions/checkout@v3
        with:
          ref: ${{github.event.pull_request.head.ref}}
          repository: ${{github.event.pull_request.head.repo.full_name}}
          token: ${{ secrets.GITHUB_TOKEN }}
      - name: Set up Python
        uses: actions/setup-python@v4
        id: python
        with:
          python-version: "3.x"
      - name: Install pre-commit
        run: |
          python3 -m pip install pre-commit
          pre-commit install-hooks --config .github/pre-commit-config.yaml
      - name: Run the check (${{ matrix.checks }})
        run: pre-commit run --hook-stage manual ${{ matrix.checks }} --all-files --config .github/pre-commit-config.yaml
      - name: Commit Changes
        if: failure()
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "fix: ${{ matrix.checks }} action"