From a0fdc81903173074e51bdac77de30a7ba56c19a9 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Tue, 7 Dec 2021 12:08:57 +0200 Subject: [PATCH] Merge pull-linter.yml and lint.yml; limit token permissions See https://github.com/wearerequired/lint-action/issues/13#issuecomment-858599203 --- .github/workflows/Pull-Linter.yml | 36 ------------------------------- .github/workflows/lint.yml | 7 +++++- 2 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/Pull-Linter.yml diff --git a/.github/workflows/Pull-Linter.yml b/.github/workflows/Pull-Linter.yml deleted file mode 100644 index 3dec7ec..0000000 --- a/.github/workflows/Pull-Linter.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Pull-Linter - -on: - pull_request: - types: ['opened', 'edited', 'reopened', 'synchronize'] - pull_request_target: - branches: [ master ] - -jobs: - run-linters: - name: Run linters - runs-on: ubuntu-latest - - steps: - - name: Check out Git repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - - name: Install Python dependencies - run: pip install black flake8 mypy - - - name: Run linters - uses: samuelmeuli/lint-action@v1 - with: - github_token: ${{ secrets.github_token }} - # Enable linters - black: true - mypy: true - flake8: true - flake8_args: "--exclude='test.py __init__.py' --max-line-length=120" - auto_fix: false - git_email: "sbidy@hotmail.com" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c983c48..d75598d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,16 @@ name: Lint on: - # Triggers the workflow on push or pull request events but only for the master branch push: branches: [ master ] pull_request: branches: [ master ] + pull_request_target: + branches: [ master ] + +permissions: + checks: write + contents: read jobs: run-linters: