Skip to content

Commit eb89480

Browse files
authored
Merge pull request #726 from bigbio/dev
Refine QPX conversion and update dependencies for workflows
2 parents 149493c + a0ef1a1 commit eb89480

51 files changed

Lines changed: 586 additions & 464 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/nf-test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ runs:
2020
using: "composite"
2121
steps:
2222
- name: Setup Nextflow
23-
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
23+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
2424
with:
2525
version: "${{ env.NXF_VERSION }}"
2626

2727
- name: Set up Python
28-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
28+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
2929
with:
3030
python-version: "3.14"
3131

@@ -37,7 +37,7 @@ runs:
3737

3838
- name: Setup apptainer
3939
if: contains(inputs.profile, 'singularity')
40-
uses: eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40 # v2
40+
uses: eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40 # v2.0.0
4141

4242
- name: Set up Singularity
4343
if: contains(inputs.profile, 'singularity')

.github/workflows/branch.yml

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,61 @@ name: nf-core branch protection
22
# This workflow is triggered on PRs to `main`/`master` branch on the repository
33
# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev`
44
on:
5-
pull_request_target:
5+
pull_request:
66
branches:
77
- main
88
- master
99

10+
permissions: {}
11+
1012
jobs:
1113
test:
1214
runs-on: ubuntu-latest
1315
steps:
1416
# PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches
1517
- name: Check PRs
1618
if: github.repository == 'bigbio/quantms'
19+
env:
20+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
1721
run: |
18-
{ [[ ${{github.event.pull_request.head.repo.full_name }} == bigbio/quantms ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
22+
{ [[ "$HEAD_REPO" == bigbio/quantms ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
1923
20-
# If the above check failed, post a comment on the PR explaining the failure
21-
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets
22-
- name: Post PR comment
24+
# If the above check failed, build a comment to be posted by the shared poster workflow
25+
- name: Build PR comment
2326
if: failure()
24-
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0 # v3
25-
with:
26-
message: |
27-
## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x:
27+
env:
28+
PR_NUMBER: ${{ github.event.pull_request.number }}
29+
BASE_REF: ${{ github.event.pull_request.base.ref }}
30+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
31+
PR_USER: ${{ github.event.pull_request.user.login }}
32+
run: |
33+
mkdir -p pr-comment
34+
echo "$PR_NUMBER" > pr-comment/pr_number.txt
35+
echo "branch" > pr-comment/header.txt
36+
cat > pr-comment/comment.md <<EOF
37+
## This PR is against the \`${BASE_REF}\` branch :x:
2838
29-
* Do not close this PR
30-
* Click _Edit_ and change the `base` to `dev`
31-
* This CI test will remain failed until you push a new commit
39+
* Do not close this PR
40+
* Click _Edit_ and change the \`base\` to \`dev\`
41+
* This CI test will remain failed until you push a new commit
3242
33-
---
43+
---
3444
35-
Hi @${{ github.event.pull_request.user.login }},
45+
Hi @${PR_USER},
3646
37-
It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch.
38-
The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release.
39-
Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch.
47+
It looks like this pull-request is has been made against the [${HEAD_REPO}](https://github.com/${HEAD_REPO}) ${BASE_REF} branch.
48+
The ${BASE_REF} branch on nf-core repositories should always contain code from the latest release.
49+
Because of this, PRs to ${BASE_REF} are only allowed if they come from the [${HEAD_REPO}](https://github.com/${HEAD_REPO}) \`dev\` branch.
4050
41-
You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page.
42-
Note that even after this, the test will continue to show as failing until you push a new commit.
51+
You do not need to close this PR, you can change the target branch to \`dev\` by clicking the _"Edit"_ button at the top of this page.
52+
Note that even after this, the test will continue to show as failing until you push a new commit.
4353
44-
Thanks again for your contribution!
45-
repo-token: ${{ secrets.GITHUB_TOKEN }}
46-
allow-repeats: false
54+
Thanks again for your contribution!
55+
EOF
56+
57+
- name: Upload PR comment artifact
58+
if: failure()
59+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
60+
with:
61+
name: pr-comment
62+
path: pr-comment/

.github/workflows/clean-up.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
issues: write
1111
pull-requests: write
1212
steps:
13-
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
13+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11
1414
with:
1515
stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days."
1616
stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful."

.github/workflows/download_pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ jobs:
3939
needs: configure
4040
steps:
4141
- name: Check out pipeline code
42-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
42+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
4343

4444
- name: Install Nextflow
45-
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
45+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
4646

4747
- name: Disk space cleanup
4848
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
4949

50-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
50+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
5151
with:
5252
python-version: "3.14"
5353
architecture: "x64"

.github/workflows/fix_linting.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
# Use the @nf-core-bot token to check out so we can push later
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
1717
with:
1818
token: ${{ secrets.nf_core_bot_auth_token }}
1919

@@ -32,12 +32,12 @@ jobs:
3232
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
3333

3434
- name: Install Nextflow
35-
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
35+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
3636

3737
# Install and run prek
3838
- name: Run prek
3939
id: prek
40-
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2
40+
uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2
4141
continue-on-error: true
4242

4343
# indication that the linting has finished

.github/workflows/linting.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ jobs:
1111
pre-commit:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
14+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
1515

1616
- name: Install Nextflow
17-
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
17+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
1818

1919
- name: Run prek
20-
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2
20+
uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2
2121

2222
nf-core:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Check out pipeline code
26-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2727

2828
- name: Install Nextflow
29-
uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3
29+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
3030

31-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
31+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
3232
with:
3333
python-version: "3.14"
3434
architecture: "x64"
3535

3636
- name: Setup uv
37-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
37+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
3838

3939
- name: read .nf-core.yml
4040
uses: pietrobolcato/action-read-yaml@9f13718d61111b69f30ab4ac683e67a56d254e1d # 1.1.0
@@ -46,7 +46,7 @@ jobs:
4646
run: uv tool install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
4747

4848
- name: Run nf-core pipelines lint
49-
if: ${{ github.base_ref != 'master' || github.base_ref != 'main' }}
49+
if: ${{ github.base_ref != 'master' && github.base_ref != 'main' }}
5050
env:
5151
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -74,3 +74,21 @@ jobs:
7474
lint_log.txt
7575
lint_results.md
7676
PR_number.txt
77+
78+
# Build a comment for the shared pr-comment.yml poster to publish on the PR
79+
- name: Prepare PR comment
80+
if: ${{ always() }}
81+
env:
82+
PR_NUMBER: ${{ github.event.pull_request.number }}
83+
run: |
84+
mkdir -p pr-comment
85+
echo "$PR_NUMBER" > pr-comment/pr_number.txt
86+
echo "lint" > pr-comment/header.txt
87+
[ -f lint_results.md ] && cp lint_results.md pr-comment/comment.md || true
88+
89+
- name: Upload PR comment artifact
90+
if: ${{ always() }}
91+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
92+
with:
93+
name: pr-comment
94+
path: pr-comment/

.github/workflows/nf-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
rm -rf ./* || true
4141
rm -rf ./.??* || true
4242
ls -la ./
43-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
43+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
4444
with:
4545
fetch-depth: 0
4646

@@ -85,7 +85,7 @@ jobs:
8585
TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.total_shards }}
8686

8787
steps:
88-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
88+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
8989
with:
9090
fetch-depth: 0
9191

.github/workflows/pr-comment.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Post PR comment
2+
# Shared, privileged comment poster.
3+
#
4+
# This is the single workflow that runs with a write token. It is triggered
5+
# after any of the listed "producer" workflows complete on a pull request.
6+
# Each producer runs untrusted PR code (if any) with a read-only token and
7+
# uploads a `pr-comment` artifact describing the comment to post; this workflow
8+
# only ever reads that plain-text artifact, so no PR code is executed here.
9+
#
10+
# Artifact contract (uploaded by producers under the name `pr-comment`):
11+
# pr_number.txt - the pull request number
12+
# header.txt - sticky-comment identifier (keeps comment types separate)
13+
# comment.md - the Markdown body (omit the file to post nothing)
14+
15+
on:
16+
workflow_run:
17+
workflows:
18+
- "nf-core linting"
19+
- "nf-core template version comment"
20+
- "nf-core branch protection"
21+
- "Run nf-test"
22+
23+
permissions:
24+
actions: read
25+
contents: read
26+
pull-requests: write
27+
28+
jobs:
29+
post-comment:
30+
runs-on: ubuntu-latest
31+
if: github.event.workflow_run.event == 'pull_request'
32+
steps:
33+
- name: Download PR comment artifact
34+
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
35+
with:
36+
run_id: ${{ github.event.workflow_run.id }}
37+
name: pr-comment
38+
path: pr-comment
39+
if_no_artifact_found: ignore
40+
41+
- name: Read comment metadata
42+
id: meta
43+
run: |
44+
echo "::group::Downloaded pr-comment contents"
45+
ls -la pr-comment 2>/dev/null || echo "No pr-comment/ directory was downloaded."
46+
echo "::endgroup::"
47+
48+
if [ ! -d pr-comment ]; then
49+
echo "No pr-comment artifact found; nothing to post."
50+
exit 0
51+
fi
52+
53+
if [ ! -f pr-comment/comment.md ]; then
54+
echo "Artifact present but no comment.md; nothing to post."
55+
exit 0
56+
fi
57+
58+
pr_number=$(cat pr-comment/pr_number.txt)
59+
header=$(cat pr-comment/header.txt)
60+
echo "Found comment.md (header='$header', pr_number='$pr_number')."
61+
62+
# Guard against anything unexpected ending up in the PR number.
63+
case "$pr_number" in
64+
''|*[!0-9]*)
65+
echo "Invalid PR number: '$pr_number'"
66+
exit 1
67+
;;
68+
esac
69+
70+
echo "pr_number=$pr_number" >> "$GITHUB_OUTPUT"
71+
echo "header=$header" >> "$GITHUB_OUTPUT"
72+
echo "post=true" >> "$GITHUB_OUTPUT"
73+
echo "Will post comment to PR #${pr_number}."
74+
75+
- name: Post PR comment
76+
if: steps.meta.outputs.post == 'true'
77+
uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5
78+
with:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
number: ${{ steps.meta.outputs.pr_number }}
81+
header: ${{ steps.meta.outputs.header }}
82+
path: pr-comment/comment.md

.github/workflows/template-version-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check out pipeline code
12-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
12+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
1313
with:
1414
ref: ${{ github.event.pull_request.head.sha }}
1515

.hooks/block_pipeline_outdir.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
# This hook is used to block commits if they include staged files inside a directory
3+
# which also contains a subdirectory called `pipeline_info`. The purpose of this is to
4+
# prevent users from inadvertently committing output from pipeline test runs inside the
5+
# development directory.
6+
7+
set -e
8+
9+
status=0
10+
seen_dirs=""
11+
12+
while IFS= read -r file; do
13+
# The offending output bundle's root is the ancestor directory that has
14+
# `pipeline_info` as an immediate child, so callers can restore it in one go.
15+
if [[ "$file" == pipeline_info/* ]]; then
16+
top_dir="pipeline_info"
17+
elif [[ "$file" == */pipeline_info/* ]]; then
18+
top_dir="${file%%/pipeline_info/*}"
19+
else
20+
top_dir=""
21+
dir=$(dirname "$file")
22+
while [[ "$dir" != "." && "$dir" != "/" ]]; do
23+
if [[ -d "$dir/pipeline_info" ]]; then
24+
top_dir="$dir"
25+
break
26+
fi
27+
dir=$(dirname "$dir")
28+
done
29+
fi
30+
31+
if [[ -n "$top_dir" ]]; then
32+
echo "❌ Commit blocked: Please do not commit output from pipeline test runs to the pipeline code itself: $file"
33+
status=1
34+
case "$seen_dirs" in
35+
*"|$top_dir|"*) ;;
36+
*)
37+
echo "Run 'git restore --staged $top_dir' to remove the whole output folder from the staging area."
38+
seen_dirs="$seen_dirs|$top_dir|"
39+
;;
40+
esac
41+
fi
42+
done < <(git diff --cached --name-only)
43+
44+
exit "$status"

0 commit comments

Comments
 (0)