diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index c315fdb148..9a1158c3ee 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -23,6 +23,10 @@ on: description: "Pipeline to sync" type: string default: "all" + debug: + description: "Enable debug/verbose mode (true or false)" + type: boolean + default: false # Cancel if a newer run is started concurrency: @@ -88,6 +92,7 @@ jobs: version: "latest-everything" - name: Set Git default branch from nextflow.config and set git default branch to that or "master" + run: | cd nf-core/${{ matrix.pipeline }} defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2) @@ -95,6 +100,7 @@ jobs: defaultBranch="master" fi echo "Default branch: $defaultBranch" + echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT git config --global init.defaultBranch $defaultBranch - name: Run synchronisation @@ -104,7 +110,9 @@ jobs: run: | git config --global user.email "core@nf-co.re" git config --global user.name "nf-core-bot" - nf-core --log-file sync_log_${{ matrix.pipeline }}.txt pipelines sync -d nf-core/${{ matrix.pipeline }} \ + nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \ + ${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \ + pipelines sync -d nf-core/${{ matrix.pipeline }} \ --from-branch dev \ --pull-request \ --username nf-core-bot \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e1140b65a..c23bd96442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ - rocrate: Update crate with version bump and handle new contributor field ([#3334](https://github.com/nf-core/tools/pull/3334)) - set default_branch to master for now ([#3335](https://github.com/nf-core/tools/issues/3335)) - Set git defaultBranch to master in sync action ([#3337](https://github.com/nf-core/tools/pull/3337)) +- Add verbose mode to sync action ([#3339](https://github.com/nf-core/tools/pull/3339)) ### Version updates diff --git a/nf_core/pipelines/create/create.py b/nf_core/pipelines/create/create.py index ae5bea57d5..0e2c683e6f 100644 --- a/nf_core/pipelines/create/create.py +++ b/nf_core/pipelines/create/create.py @@ -298,7 +298,6 @@ def render_template(self) -> None: template_dir = Path(nf_core.__file__).parent / "pipeline-template" object_attrs = self.jinja_params object_attrs["nf_core_version"] = nf_core.__version__ - # Can't use glob.glob() as need recursive hidden dotfiles - https://stackoverflow.com/a/58126417/713980 template_files = list(Path(template_dir).glob("**/*")) template_files += list(Path(template_dir).glob("*")) @@ -433,6 +432,7 @@ def get_default_branch(self) -> None: self.default_branch = ( str(git.config.GitConfigParser().get_value("init", "defaultBranch")) or "master" ) # default to master + log.debug(f"Default branch name: {self.default_branch}") except configparser.Error: log.debug("Could not read init.defaultBranch") if self.default_branch in ["dev", "TEMPLATE"]: