Skip to content

Commit 06db03f

Browse files
authored
Merge pull request #3339 from mashehu/add-verbose-mode-to-sync
Add verbose mode to sync action
2 parents 1a22106 + 379bad0 commit 06db03f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/sync.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
description: "Pipeline to sync"
2424
type: string
2525
default: "all"
26+
debug:
27+
description: "Enable debug/verbose mode (true or false)"
28+
type: boolean
29+
default: false
2630

2731
# Cancel if a newer run is started
2832
concurrency:
@@ -88,13 +92,15 @@ jobs:
8892
version: "latest-everything"
8993

9094
- name: Set Git default branch from nextflow.config and set git default branch to that or "master"
95+
9196
run: |
9297
cd nf-core/${{ matrix.pipeline }}
9398
defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2)
9499
if [ -z "$defaultBranch" ]; then
95100
defaultBranch="master"
96101
fi
97102
echo "Default branch: $defaultBranch"
103+
echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT
98104
git config --global init.defaultBranch $defaultBranch
99105
100106
- name: Run synchronisation
@@ -104,7 +110,9 @@ jobs:
104110
run: |
105111
git config --global user.email "[email protected]"
106112
git config --global user.name "nf-core-bot"
107-
nf-core --log-file sync_log_${{ matrix.pipeline }}.txt pipelines sync -d nf-core/${{ matrix.pipeline }} \
113+
nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \
114+
${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \
115+
pipelines sync -d nf-core/${{ matrix.pipeline }} \
108116
--from-branch dev \
109117
--pull-request \
110118
--username nf-core-bot \

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
- rocrate: Update crate with version bump and handle new contributor field ([#3334](https://github.com/nf-core/tools/pull/3334))
6868
- set default_branch to master for now ([#3335](https://github.com/nf-core/tools/issues/3335))
6969
- Set git defaultBranch to master in sync action ([#3337](https://github.com/nf-core/tools/pull/3337))
70+
- Add verbose mode to sync action ([#3339](https://github.com/nf-core/tools/pull/3339))
7071

7172
### Version updates
7273

nf_core/pipelines/create/create.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ def render_template(self) -> None:
298298
template_dir = Path(nf_core.__file__).parent / "pipeline-template"
299299
object_attrs = self.jinja_params
300300
object_attrs["nf_core_version"] = nf_core.__version__
301-
302301
# Can't use glob.glob() as need recursive hidden dotfiles - https://stackoverflow.com/a/58126417/713980
303302
template_files = list(Path(template_dir).glob("**/*"))
304303
template_files += list(Path(template_dir).glob("*"))
@@ -433,6 +432,7 @@ def get_default_branch(self) -> None:
433432
self.default_branch = (
434433
str(git.config.GitConfigParser().get_value("init", "defaultBranch")) or "master"
435434
) # default to master
435+
log.debug(f"Default branch name: {self.default_branch}")
436436
except configparser.Error:
437437
log.debug("Could not read init.defaultBranch")
438438
if self.default_branch in ["dev", "TEMPLATE"]:

0 commit comments

Comments
 (0)