From 856f12fa224688a876df1f8bf57d581c68e3a4bd Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Tue, 2 Sep 2025 16:00:59 +0100 Subject: [PATCH 1/2] Use branch-deploy action to determine who is allowed to trigger this workflow. --- .github/workflows/changelog.yml | 21 ++++++++----------- .../workflows/update-textual-snapshots.yml | 17 ++++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 981476d917..141a5a8679 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,24 +1,21 @@ name: Update CHANGELOG.md on: issue_comment: - types: [created] - pull_request_target: - types: [opened] - branches: - - dev + types: [created] # Add "@nf-core-bot changelog" as a PR comment to trigger this workflow. jobs: update_changelog: runs-on: ubuntu-latest - # Run if comment is on a PR with the main repo, and if it contains the magic keywords. - # Or run on PR creation, unless asked otherwise in the title. - if: | - github.repository_owner == 'nf-core' && ( - github.event_name == 'pull_request_target' || - github.event.issue.pull_request && startsWith(github.event.comment.body, '@nf-core-bot changelog') - ) steps: + - name: branch-deploy + id: branch-deploy + uses: github/branch-deploy@c9fcc362bdcea69eecac6578dde245cd5e3a55bf # v10.4.3 + with: + trigger: "@nf-core-bot changelog" + reaction: "eyes" + stable_branch: "dev" + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }} diff --git a/.github/workflows/update-textual-snapshots.yml b/.github/workflows/update-textual-snapshots.yml index 5f25ce955d..939079abd2 100644 --- a/.github/workflows/update-textual-snapshots.yml +++ b/.github/workflows/update-textual-snapshots.yml @@ -1,18 +1,21 @@ name: Update Textual snapshots from a comment on: issue_comment: - types: [created] + types: [created] # Add "@nf-core-bot update textual snapshots" as a PR comment to trigger this workflow. jobs: update-snapshots: - # Only run if comment is on a PR with the main repo, and if it contains the magic keywords - if: > - contains(github.event.comment.html_url, '/pull/') && - contains(github.event.comment.body, '@nf-core-bot') && - contains(github.event.comment.body, 'update textual snapshots') && - github.repository == 'nf-core/tools' runs-on: ubuntu-latest + steps: + - name: branch-deploy + id: branch-deploy + uses: github/branch-deploy@c9fcc362bdcea69eecac6578dde245cd5e3a55bf # v10.4.3 + with: + trigger: "@nf-core-bot update textual snapshots" + reaction: "eyes" + stable_branch: "dev" + # Use the @nf-core-bot token to check out so we can push later - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: From e97ed07614088c919316cc19b2b91ae298af5666 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Tue, 30 Sep 2025 15:09:42 +0000 Subject: [PATCH 2/2] [automated] Fix code linting --- .github/workflows/changelog.yml | 2 +- .github/workflows/update-textual-snapshots.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 141a5a8679..946f1e58d7 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,7 +1,7 @@ name: Update CHANGELOG.md on: issue_comment: - types: [created] # Add "@nf-core-bot changelog" as a PR comment to trigger this workflow. + types: [created] # Add "@nf-core-bot changelog" as a PR comment to trigger this workflow. jobs: update_changelog: diff --git a/.github/workflows/update-textual-snapshots.yml b/.github/workflows/update-textual-snapshots.yml index 939079abd2..17eba479cd 100644 --- a/.github/workflows/update-textual-snapshots.yml +++ b/.github/workflows/update-textual-snapshots.yml @@ -1,7 +1,7 @@ name: Update Textual snapshots from a comment on: issue_comment: - types: [created] # Add "@nf-core-bot update textual snapshots" as a PR comment to trigger this workflow. + types: [created] # Add "@nf-core-bot update textual snapshots" as a PR comment to trigger this workflow. jobs: update-snapshots: