Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ android_analysis = [
"android_inspector==0.0.1"
]
mining = [
"minecode_pipelines==0.0.1b23"
"minecode_pipelines==0.0.1b24"
]

[project.urls]
Expand Down
21 changes: 20 additions & 1 deletion scanpipe/pipes/federatedcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,31 @@ def commit_and_push_changes(
commit_message=None,
purls=None,
remote_name="origin",
logger=None,
mine_type="packageURL",
tool_name="pkg:github/aboutcode-org/scancode.io",
tool_version=VERSION,
logger=print
):
"""
Commit and push changes to remote repository.
Returns True if changes are successfully pushed, False otherwise.
"""

if not commit_message:
author_name = settings.FEDERATEDCODE_GIT_SERVICE_NAME
author_email = settings.FEDERATEDCODE_GIT_SERVICE_EMAIL

purls = "\n".join(purls)
commit_message = textwrap.dedent(f"""\
Add {mine_type} results for:
{purls}

Tool: {tool_name}@v{tool_version}
Reference: https://{settings.ALLOWED_HOSTS[0]}

Signed-off-by: {author_name} <{author_email}>
""")
Comment on lines +211 to +224
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why we need to compute commit_message here? when we already take care of missing commit message in commit_changes function.


try:
commit_changes(repo, files_to_commit, commit_message, purls, logger)
push_changes(repo, remote_name)
Expand Down
Loading