Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PULL_REQUEST_TEMPLATE.md fails files_unchanged linting test depending on local choice of default branch #3423

Open
alexlyttle opened this issue Jan 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@alexlyttle
Copy link

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

  1. nf-core pipelines lint will fail when run on a device where git config --global init.defaultBranch is set to anything other than the value used when creating PULL_REQUEST_TEMPLATE.md from the template

  2. The linting.yml workflow will fail if the default branch set when creating PULL_REQUEST_TEMPLATE.md is anything other than master

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 lint

System information

  • nf-core/tools v3.1.2
  • macOS, Ubuntu Linux
  • Python 3.10, 3.11, 3.12
  • Nextflow 24.04, 24.11
@alexlyttle alexlyttle added the bug Something isn't working label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant