Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitleaks Summary Generated Urls Broken #121

Open
Tjhayhay opened this issue Jul 10, 2023 · 1 comment · May be fixed by #166
Open

Gitleaks Summary Generated Urls Broken #121

Tjhayhay opened this issue Jul 10, 2023 · 1 comment · May be fixed by #166

Comments

@Tjhayhay
Copy link

Heyo!

The gitleaks summary is generating urls that are broken for all my private Org repos for all workflow event types.

The Url generated for example is https://github.com///actions/runs/undefined/commit/21f3bb48c90c82c688feb801ed5d539a6472273b

If I take out the "actions/runs/undefined" part of the url it seems to at least land on the commit page.

Any ideas whats happening here?

It seems odd because the url seems like it should be created based off eventJSON.repository.html_url and when I view that in the pipeline it looks correct without the actions/runs/undefined bit added.

@acidghost
Copy link

The URL is taken from

const repo_url = eventJSON.repository.html_url;

But unfortunately it's overwritten if the workflow is scheduled with a cron (i.e. event type schedule)

// eventJSON.repository is undefined for scheduled events
if (eventType == "schedule") {
githubUsername = process.env.GITHUB_REPOSITORY_OWNER;
eventJSON.repository = {
owner: {
login: process.env.GITHUB_REPOSITORY_OWNER,
},
full_name: process.env.GITHUB_REPOSITORY,
};

I have tested privately that the JSON file read into eventJSON contains repository.html_url, so IMO that if branch is obsolete and can be removed. Unfortunately I'm unable to find documentation to back this up...

@acidghost acidghost linked a pull request Oct 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants