Skip to content

github_action fails when action uses commit-sha #714

@npetzall

Description

@npetzall

def _get_git_tarball_url(self, repo: str, version=None) -> str:
if not version:
return f"https://api.github.com/repos/{repo}/zipball"
else:
return f"https://github.com/{repo}/archive/refs/tags/{version}.zip"

When commit-sha is used the url should be:
f"https://github.com/{repo}/archive/{version}.zip"

and if branch would be used:
f"https://github.com/{repo}/archive/refs/heads/{version}.zip"

Matching could be done for commit-sha since it has a pattern; content, length

However there is a bigger issue with branch vs tag.

This is version 2.9.0 affects both scan and verify since it's the same code used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions