Skip to content

Nextflow version not propagating to nf-test/action.yml for github ci nf-tests #3799

@apetkau

Description

@apetkau

Description of the bug

I was in the process of merging in some of the more recent GitHub Actions changes from nf-core into my own pipelines and I noticed that the tests that should be run against the minimum Nextflow version for my pipeline (23.04.0) were instead running against the latest version of Nextflow (25.04.7).

In the GitHub Actions logs, I traced this to setup-nextflow/subaction step where it looks like the Nextflow version is an empty string, so it's defaulting to latest Nextflow:

Image

It looks like this may be due to a mismatch in variable names/setting environment variables in the GitHub actions templates made by nf-core.

In the below block of code, the Nextflow version is set under matrix and named NXF_VER:

matrix:
shard: ${{ fromJson(needs.nf-test-changes.outputs.shard) }}
profile: [conda, docker, singularity]
isMain:
- ${{ github.base_ref == 'master' || github.base_ref == 'main' }}
# Exclude conda and singularity on dev
exclude:
- isMain: false
profile: "conda"
- isMain: false
profile: "singularity"
NXF_VER:
- "24.10.5"
- "latest-everything"

However, in this block of code, it looks like the nf-core/setup-nextflow action is pulling the Nextflow version from an environment variable named NXF_VERSION:

- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "{% raw %}${{ env.NXF_VERSION }}"

I fixed this in my code by setting an environment variable env.NXF_VERSION with the value from matrix.NXF_VERSION in this block of code:

env:
NXF_ANSI_LOG: false
TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.total_shards }}

That is, I added the line:

NXF_VERSION: "${{ matrix.NXF_VER }}"

This seems to fix the issue and the correct Nextflow version gets installed:

Image

Command used and terminal output

System information

I created a template using nf-core version 3.3.2 and copied the GitHub actions and workflows into my own pipeline code to keep myself up-to-date.

The pipeline I was updating is here https://github.com/phac-nml/speciesabundance which is maintained by our organization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions