Skip to content

Commit d809a90

Browse files
authored
add nextflow version fallback to sync action (#4425)
1 parent 87320d9 commit d809a90

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/sync.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,31 @@ jobs:
108108
git config --global init.defaultBranch $defaultBranch
109109
110110
- name: Run synchronisation
111+
id: sync
111112
if: github.repository == 'nf-core/tools'
113+
continue-on-error: true
114+
env:
115+
GITHUB_AUTH_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
116+
run: |
117+
git config --global user.email "core@nf-co.re"
118+
git config --global user.name "nf-core-bot"
119+
uv run nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \
120+
${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \
121+
pipelines sync -d nf-core/${{ matrix.pipeline }} \
122+
--from-branch dev \
123+
--pull-request \
124+
--username nf-core-bot \
125+
--github-repository nf-core/${{ matrix.pipeline }} \
126+
--blog-post ${{inputs.blog_post}}
127+
128+
- name: Install newer Nextflow (retry fallback)
129+
if: github.repository == 'nf-core/tools' && steps.sync.outcome == 'failure'
130+
uses: nf-core/setup-nextflow@893c28b667aedeba26e37f296d260ccc5bc4d914 # v3
131+
with:
132+
version: "26.04.6"
133+
134+
- name: Retry synchronisation with newer Nextflow
135+
if: github.repository == 'nf-core/tools' && steps.sync.outcome == 'failure'
112136
env:
113137
GITHUB_AUTH_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
114138
run: |

nf_core/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,12 @@ def fetch_wf_config(wf_path: Path, cache_config: bool = True) -> dict:
553553
log.debug("No config cache found")
554554

555555
# Call `nextflow config`
556-
result = run_cmd("nextflow", f"config -o json {wf_path}")
556+
try:
557+
result = run_cmd("nextflow", f"config -o json {wf_path}")
558+
except RuntimeError as e:
559+
raise UserWarning(
560+
f"Could not parse Nextflow config for '{wf_path}'. Possibly because of a Nextflow version mismatch?\n{e}"
561+
) from e
557562
if result is not None:
558563
nfconfig_raw, _ = result
559564
try:

0 commit comments

Comments
 (0)