Skip to content

Commit

Permalink
add verbose mode to sync action
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Dec 10, 2024
1 parent 1a22106 commit fa4e074
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,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 +106,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 \
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 fa4e074

Please sign in to comment.