-
Notifications
You must be signed in to change notification settings - Fork 223
Description
Description of the bug
Context
It appears a recent update to PULL_REQUEST_TEMPLATE.md takes whatever the git init default branch is set to locally when building from the template. Working on a pipeline for a non-nf-core organisation, I performed a manual sync on my device (nf-core v3.1.2). Then, nf-core pipelines lint passed when I ran it locally. However, the linting.yml action workflow failed on GitHub with
╭─ [✗] 1 Pipeline Test Failed ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ files_unchanged: .github/PULL_REQUEST_TEMPLATE.md does not match the template │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯On my device, I have set my default git branch to main with git config --global init.defaultBranch main. It appears the template takes this into account when creating PULL_REQUEST_TEMPLATE.md. However, the linting.yml GitHub Actions environment default git branch is master. When I set git config --global init.defaultBranch master locally and reran nf-core pipelines lint, I could reproduce the above error. I then ran again with --fix files_unchanged, pushed the changes, and the GitHub Action workflow succeeded.
Problems
-
nf-core pipelines lintwill fail when run on a device wheregit config --global init.defaultBranchis set to anything other than the value used when creatingPULL_REQUEST_TEMPLATE.mdfrom the template -
The
linting.ymlworkflow will fail if the default branch set when creatingPULL_REQUEST_TEMPLATE.mdis anything other thanmaster
Solution
Use the GitHub API to get the default_branch for the pipeline when creating the template (e.g. see here)
Command used and terminal output
Go to any pipeline on your machine and run
git config --global init.defaultBranch anything-different
then run,
nf-core pipelines lintSystem information
- nf-core/tools v3.1.2
- macOS, Ubuntu Linux
- Python 3.10, 3.11, 3.12
- Nextflow 24.04, 24.11