From d9e3627d427db36c4ee736c755e865e411b779eb Mon Sep 17 00:00:00 2001 From: Takashi Masuda Date: Mon, 17 Jun 2024 13:04:47 +0900 Subject: [PATCH 1/5] It is more appropriate to run the ls-lint job as a Test workflow --- .github/workflows/my_setup_pr.yml | 6 ------ .github/workflows/my_test.yml | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/my_setup_pr.yml b/.github/workflows/my_setup_pr.yml index 0954721..cddb6ab 100644 --- a/.github/workflows/my_setup_pr.yml +++ b/.github/workflows/my_setup_pr.yml @@ -13,9 +13,3 @@ concurrency: jobs: add-assignee-to-pr: uses: ./.github/workflows/add_assignee_to_pr.yml - - ls-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ls-lint/action@v2.2.3 diff --git a/.github/workflows/my_test.yml b/.github/workflows/my_test.yml index e4fe43a..5a33e9e 100644 --- a/.github/workflows/my_test.yml +++ b/.github/workflows/my_test.yml @@ -23,3 +23,9 @@ jobs: filter_mode: nofilter level: error reporter: github-pr-review + + ls-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ls-lint/action@v2.2.3 From be64b5c063171479761a73619e229cd33cd2de24 Mon Sep 17 00:00:00 2001 From: Takashi Masuda Date: Mon, 17 Jun 2024 13:05:04 +0900 Subject: [PATCH 2/5] Avoid long runs --- .github/workflows/my_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/my_test.yml b/.github/workflows/my_test.yml index 5a33e9e..e8dc6f0 100644 --- a/.github/workflows/my_test.yml +++ b/.github/workflows/my_test.yml @@ -26,6 +26,7 @@ jobs: ls-lint: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: ls-lint/action@v2.2.3 From 677379d1e7c14d851ef21480d4c00c4ef6048bd7 Mon Sep 17 00:00:00 2001 From: Takashi Masuda Date: Mon, 17 Jun 2024 15:29:07 +0900 Subject: [PATCH 3/5] Improve permissions scope --- .github/workflows/add_assignee_to_pr.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/add_assignee_to_pr.yml b/.github/workflows/add_assignee_to_pr.yml index 48802ce..43f20ca 100644 --- a/.github/workflows/add_assignee_to_pr.yml +++ b/.github/workflows/add_assignee_to_pr.yml @@ -12,14 +12,13 @@ on: workflow_call: -permissions: - pull-requests: write - jobs: add-assignee-to-pr: name: Add assignee to PR runs-on: ubuntu-latest timeout-minutes: 1 + permissions: + pull-requests: write if: ${{ github.event.pull_request.user.type != 'Bot' && toJSON(github.event.pull_request.assignees) == '[]' }} From 7d387d8736822a2535fa391399b9eda001b65abb Mon Sep 17 00:00:00 2001 From: Takashi Masuda Date: Mon, 17 Jun 2024 15:29:14 +0900 Subject: [PATCH 4/5] Follow my usage --- .github/workflows/my_setup_pr.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/my_setup_pr.yml b/.github/workflows/my_setup_pr.yml index cddb6ab..6b8dac6 100644 --- a/.github/workflows/my_setup_pr.yml +++ b/.github/workflows/my_setup_pr.yml @@ -2,13 +2,7 @@ name: Setup PR on: pull_request: - -permissions: - pull-requests: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + types: [opened] jobs: add-assignee-to-pr: From e32b8c73e387ee6f1b5fefd2bd7b442253304a70 Mon Sep 17 00:00:00 2001 From: Takashi Masuda Date: Mon, 17 Jun 2024 16:02:55 +0900 Subject: [PATCH 5/5] The job of branch cancel if next commits push --- .github/workflows/my_test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/my_test.yml b/.github/workflows/my_test.yml index e8dc6f0..430fae3 100644 --- a/.github/workflows/my_test.yml +++ b/.github/workflows/my_test.yml @@ -6,6 +6,10 @@ on: - main pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: actionlint: runs-on: ubuntu-latest