Skip to content

Commit

Permalink
Merge pull request #3339 from mashehu/add-verbose-mode-to-sync
Browse files Browse the repository at this point in the history
Add verbose mode to sync action
  • Loading branch information
mirpedrol authored Dec 11, 2024
2 parents 1a22106 + 379bad0 commit 06db03f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -88,13 +92,15 @@ 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)
if [ -z "$defaultBranch" ]; then
defaultBranch="master"
fi
echo "Default branch: $defaultBranch"
echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT
git config --global init.defaultBranch $defaultBranch
- name: Run synchronisation
Expand All @@ -104,7 +110,9 @@ jobs:
run: |
git config --global user.email "[email protected]"
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 \
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("*"))
Expand Down Expand Up @@ -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"]:
Expand Down

0 comments on commit 06db03f

Please sign in to comment.