diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index b4bf3b7a77..917a8127df 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,7 +1,7 @@ name: Update CHANGELOG.md on: issue_comment: - types: [created] + types: [created] # Add "@nf-core-bot changelog" as a PR comment to trigger this workflow. pull_request_target: types: [opened] branches: @@ -10,15 +10,17 @@ on: 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 + if: github.event_name == 'issue_comment' + 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/fix-linting.yml b/.github/workflows/fix-linting.yml index b68dcdd189..30fa7ba33f 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -1,29 +1,28 @@ name: Fix linting from a comment on: issue_comment: - types: [created] + types: [created] # Add "@nf-core-bot fix linting" as a PR comment to trigger this workflow. jobs: fix-linting: - # 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 fix linting') && - github.repository == 'nf-core/tools' runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: branch-deploy + id: branch-deploy + uses: github/branch-deploy@c9fcc362bdcea69eecac6578dde245cd5e3a55bf # v10.4.3 + with: + trigger: "@nf-core-bot fix linting" + 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: token: ${{ secrets.nf_core_bot_auth_token }} - # indication that the linting is being fixed - - name: React on comment - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5 - with: - comment-id: ${{ github.event.comment.id }} - reactions: eyes - # Action runs on the issue comment, so we don't get the PR by default # Use the gh cli to check out the PR - name: Checkout Pull Request diff --git a/.github/workflows/update-template-snapshots.yml b/.github/workflows/update-template-snapshots.yml index 8437bc6ecc..eeb44720c6 100644 --- a/.github/workflows/update-template-snapshots.yml +++ b/.github/workflows/update-template-snapshots.yml @@ -1,21 +1,26 @@ name: Update Template snapshots from a comment on: issue_comment: - types: [created] + types: [created] # Add "@nf-core-bot update template snapshots" as a PR comment to trigger this workflow. jobs: prepare-matrix: name: Retrieve all template features - # 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 template snapshots') && - github.repository == 'nf-core/tools' runs-on: ubuntu-latest + permissions: + pull-requests: write outputs: all_features: ${{ steps.create_matrix.outputs.matrix }} + steps: + - name: branch-deploy + id: branch-deploy + uses: github/branch-deploy@c9fcc362bdcea69eecac6578dde245cd5e3a55bf # v10.4.3 + with: + trigger: "@nf-core-bot update template snapshots" + reaction: "eyes" + stable_branch: "dev" + - name: checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 @@ -28,6 +33,8 @@ jobs: update-snapshots: needs: [prepare-matrix] runs-on: ubuntu-latest + permissions: + pull-requests: write strategy: matrix: TEMPLATE: ${{ fromJson(needs.prepare-matrix.outputs.all_features) }} @@ -40,13 +47,6 @@ jobs: with: token: ${{ secrets.nf_core_bot_auth_token }} - # indication that the command is running - - name: React on comment - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5 - with: - comment-id: ${{ github.event.comment.id }} - reactions: eyes - # Action runs on the issue comment, so we don't get the PR by default # Use the gh cli to check out the PR - name: Checkout Pull Request diff --git a/.github/workflows/update-textual-snapshots.yml b/.github/workflows/update-textual-snapshots.yml index e03825293c..e3003aeee4 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: