From cd6edbac666cab2821098928dda80432e4037f3d Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 19 Dec 2024 08:45:24 +0900 Subject: [PATCH 1/4] chore: give pr permission for reviewdog - Run linter the PR is against master branch - Run linter when pull-request triggered - Allow review dog to put review comment on PR Signed-off-by: Hiroshi Miura --- .github/workflows/run-linter.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-linter.yml b/.github/workflows/run-linter.yml index 280cd1c0..c48be78c 100644 --- a/.github/workflows/run-linter.yml +++ b/.github/workflows/run-linter.yml @@ -2,6 +2,8 @@ name: Run linter on: pull_request: + branches: + - 'master' jobs: linter: @@ -24,8 +26,10 @@ jobs: pip install -U pip tox wheel setuptools coveralls coverage[toml] pip install .[check] - name: run reviewdog + permissions: + pull-requests: write run: | - ./bin/reviewdog -runners=flake8,mypy,pylint -reporter=github-pr-check -conf=.reviewdog.yml + ./bin/reviewdog -runners=flake8,mypy,pylint -reporter=github-pr-review -conf=.reviewdog.yml env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 20eeee97807cf5cb00fc3adb91756579c0e28861 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 19 Dec 2024 09:36:59 +0900 Subject: [PATCH 2/4] chore: wip Signed-off-by: Hiroshi Miura --- .github/workflows/check.yml | 2 +- .github/workflows/run-linter.yml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 651d4d8a..ca380ac2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Check tox tests, lint and types +name: Check tox tests on: push: diff --git a/.github/workflows/run-linter.yml b/.github/workflows/run-linter.yml index c48be78c..f5749abd 100644 --- a/.github/workflows/run-linter.yml +++ b/.github/workflows/run-linter.yml @@ -3,7 +3,11 @@ name: Run linter on: pull_request: branches: - - 'master' + - master + types: + - opened + - synchronize + - reopened jobs: linter: From 7de00b2bbc6f4c0d62b940b8cf19cee6c2885a03 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 19 Dec 2024 09:53:34 +0900 Subject: [PATCH 3/4] chore: github actions jobs permissions Signed-off-by: Hiroshi Miura --- .github/workflows/run-linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-linter.yml b/.github/workflows/run-linter.yml index f5749abd..1fc42205 100644 --- a/.github/workflows/run-linter.yml +++ b/.github/workflows/run-linter.yml @@ -13,6 +13,8 @@ jobs: linter: name: Linter runs-on: ubuntu-24.04 + permissions: + pull-requests: write steps: - uses: actions/checkout@v4 with: @@ -30,8 +32,6 @@ jobs: pip install -U pip tox wheel setuptools coveralls coverage[toml] pip install .[check] - name: run reviewdog - permissions: - pull-requests: write run: | ./bin/reviewdog -runners=flake8,mypy,pylint -reporter=github-pr-review -conf=.reviewdog.yml env: From 281352a39eed71182ae7e6d8127fb346f8553638 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 19 Dec 2024 09:54:35 +0900 Subject: [PATCH 4/4] chore: ci: drop pylint from linter action Signed-off-by: Hiroshi Miura --- .github/workflows/run-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-linter.yml b/.github/workflows/run-linter.yml index 1fc42205..3b1b44f3 100644 --- a/.github/workflows/run-linter.yml +++ b/.github/workflows/run-linter.yml @@ -33,7 +33,7 @@ jobs: pip install .[check] - name: run reviewdog run: | - ./bin/reviewdog -runners=flake8,mypy,pylint -reporter=github-pr-review -conf=.reviewdog.yml + ./bin/reviewdog -runners=flake8,mypy -reporter=github-pr-review -conf=.reviewdog.yml env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}