Skip to content

Consolidate and harden PR-comment GitHub Actions workflows - #1872

Draft
ewels wants to merge 1 commit into
masterfrom
claude/blissful-goodall-a315fe
Draft

Consolidate and harden PR-comment GitHub Actions workflows#1872
ewels wants to merge 1 commit into
masterfrom
claude/blissful-goodall-a315fe

Conversation

@ewels

@ewels ewels commented Jun 22, 2026

Copy link
Copy Markdown
Member

Tidies up and hardens the GitHub Actions workflows that post comments on PRs.

What changes

  • Adds a single shared pr-comment.yml workflow as the only one that runs with a write token. It is triggered via workflow_run after a producer workflow completes, downloads a standard pr-comment artifact, and posts the comment.
  • The "producer" workflows — linting, template-version-comment, and branch — now run on pull_request with read-only tokens and just upload a pr-comment artifact (pr_number.txt, header.txt, optional comment.md). They no longer post comments directly.
  • Removes the now-redundant linting_comment.yml and template-version-comment-action.yml.

Why

  • One small, auditable workflow holds the write permission instead of several.
  • Producer jobs no longer run any PR-derived input in a privileged context, and a shell-injection vector when building the install command / comment body is removed.
  • Sticky comment headers keep each comment type independent, so they update in place as before.

No change to the comments contributors actually see (lint results, template-version warning, branch-protection notice all still post, including on fork PRs).

Draft for review.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

nf-core pipelines lint overall result: Failed ❌

Posted for pipeline commit 85c0f76

+| ✅ 211 tests passed       |+
#| ❔  20 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   7 tests had warnings |!
-| ❌   3 tests failed       |-
Details

❌ Test failures:

  • files_exist - File not found: .github/workflows/linting_comment.yml
  • files_unchanged - .github/workflows/branch.yml does not match the template
  • files_unchanged - .github/workflows/linting.yml does not match the template

❗ Test warnings:

  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required

❔ Tests ignored:

  • files_exist - File is ignored: conf/modules.config
  • files_exist - File is ignored: conf/containers_conda_lock_files_amd64.config
  • files_exist - File is ignored: conf/containers_conda_lock_files_arm64.config
  • files_exist - File is ignored: conf/containers_docker_amd64.config
  • files_exist - File is ignored: conf/containers_docker_arm64.config
  • files_exist - File is ignored: conf/containers_singularity_https_amd64.config
  • files_exist - File is ignored: conf/containers_singularity_https_arm64.config
  • files_exist - File is ignored: conf/containers_singularity_oras_amd64.config
  • files_exist - File is ignored: conf/containers_singularity_oras_arm64.config
  • nextflow_config - Config default ignored: params.ribo_database_manifest
  • nf_test_content - nf_test_content
  • files_unchanged - File does not exist: .github/workflows/linting_comment.yml
  • files_unchanged - File ignored due to lint config: assets/email_template.html
  • files_unchanged - File ignored due to lint config: assets/email_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-rnaseq_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-rnaseq_logo_dark.png
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore
  • actions_nf_test - actions_nf_test
  • modules_config - modules_config
  • container_configs - container_configs

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.2
  • Run at 2026-06-22 10:23:44

@ewels ewels changed the title Harden template version comment GitHub Actions workflow Consolidate and harden PR-comment GitHub Actions workflows Jun 22, 2026
Add a single shared pr-comment.yml as the only workflow that runs with a
write token. It is triggered via workflow_run after a producer workflow
completes, downloads a standard pr-comment artifact, and posts the comment.

The producer workflows (linting, template version, branch protection) now
run on pull_request with read-only tokens and only upload a pr-comment
artifact (pr_number.txt, header.txt, optional comment.md). This removes the
pull_request_target triggers, drops a shell-injection vector when building
the install command and comment body, and replaces the duplicated poster
workflows (linting_comment.yml, template-version-comment-action.yml).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFdLvcJv6tHEB8fJWVwdAv
@ewels
ewels force-pushed the claude/blissful-goodall-a315fe branch from f46b42f to 85c0f76 Compare June 22, 2026 10:19
@ewels
ewels changed the base branch from dev to master June 22, 2026 10:19
@ewels

ewels commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

nf-core/testpipeline equivalent: nf-core/testpipeline#148

mashehu pushed a commit to mashehu/testpipeline that referenced this pull request Jun 23, 2026
Adds a single shared `pr-comment.yml` workflow as the only one that runs
with a write token. It is triggered via `workflow_run` after a producer
workflow completes, downloads a standard `pr-comment` artifact, and posts
the comment.

The producer workflows — `linting`, `template-version-comment`, and
`branch` — now run on `pull_request` with read-only tokens and just upload
a `pr-comment` artifact (`pr_number.txt`, `header.txt`, optional
`comment.md`). They no longer post comments directly.

Removes the now-redundant `linting_comment.yml`.

Ported from nf-core/rnaseq#1872.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

# Conflicts:
#	.github/workflows/branch.yml
#	.github/workflows/linting_comment.yml
#	.github/workflows/template-version-comment.yml
mashehu pushed a commit to mashehu/testpipeline that referenced this pull request Jun 23, 2026
Adds a single shared `pr-comment.yml` workflow as the only one that runs
with a write token. It is triggered via `workflow_run` after a producer
workflow completes, downloads a standard `pr-comment` artifact, and posts
the comment.

The producer workflows — `linting`, `template-version-comment`, and
`branch` — now run on `pull_request` with read-only tokens and just upload
a `pr-comment` artifact (`pr_number.txt`, `header.txt`, optional
`comment.md`). They no longer post comments directly.

Removes the now-redundant `linting_comment.yml`.

Ported from nf-core/rnaseq#1872.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants