From 0bbaeadcededbb91b8037e84e5330fbbd407487e Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 8 Oct 2024 17:30:35 +0200 Subject: [PATCH 1/4] Template: run awsfulltest only when target branch is `master` --- nf_core/pipeline-template/.github/workflows/awsfulltest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml index dc0450be43..dc220125ed 100644 --- a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -14,7 +14,8 @@ on: jobs: run-platform: name: Run AWS full tests - if: github.repository == '{{ name }}' && github.event.review.state == 'approved' + # run only if the PR is approved by at least 2 reviewers and against the master branch + if: github.repository == '{{ name }}' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' runs-on: ubuntu-latest steps: - uses: octokit/request-action@v2.x From c20122fcdcd0a4d25fd91f4605ef31350f4074d3 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 8 Oct 2024 17:37:14 +0200 Subject: [PATCH 2/4] fix github variable --- nf_core/pipeline-template/.github/workflows/awsfulltest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml index dc220125ed..061f2dee04 100644 --- a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -21,7 +21,7 @@ jobs: - uses: octokit/request-action@v2.x id: check_approvals with: - route: GET /repos/{%- raw -%}${{ github.repository }}/pulls/${{ github.event.review.number }}/reviews + route: GET /repos/{%- raw -%}${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: test_variables From a995dbc4081bbec496673b30d17c5f58c1f8b056 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 8 Oct 2024 17:41:01 +0200 Subject: [PATCH 3/4] still allow manual dispatch --- nf_core/pipeline-template/.github/workflows/awsfulltest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml index 061f2dee04..3aa2f7de87 100644 --- a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -14,8 +14,8 @@ on: jobs: run-platform: name: Run AWS full tests - # run only if the PR is approved by at least 2 reviewers and against the master branch - if: github.repository == '{{ name }}' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' + # run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered + if: github.repository == '{{ name }}' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: octokit/request-action@v2.x From d00d36b62f2844df471a78fcae445fa05eebf611 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 8 Oct 2024 17:46:54 +0200 Subject: [PATCH 4/4] update changelog, fix if condition --- CHANGELOG.md | 5 +++-- nf_core/pipeline-template/.github/workflows/awsfulltest.yml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 709e7b6ea6..8c13e54f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## v3.0.1dev -### Bug fixes +### Template -- Fixed an issue where the linting CI action didn't read the correct file +- Fixed an issue where the linting CI action didn't read the correct file ([#3202](https://github.com/nf-core/tools/pull/3202)) +- Fixed condition for `awsfulltest` to run ([#3203](https://github.com/nf-core/tools/pull/3203)) ## [v3.0.0 - Titanium Tapir](https://github.com/nf-core/tools/releases/tag/3.0.0) - [2024-10-08] diff --git a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml index 3aa2f7de87..d8987330d5 100644 --- a/nf_core/pipeline-template/.github/workflows/awsfulltest.yml +++ b/nf_core/pipeline-template/.github/workflows/awsfulltest.yml @@ -25,6 +25,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: test_variables + if: github.event_name != 'workflow_dispatch' run: | JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'{% endraw %} CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')