Skip to content

fix(github-format): preserve path#1748

Open
reubenwong97 wants to merge 2 commits intozizmorcore:mainfrom
reubenwong97:fix/missing-path
Open

fix(github-format): preserve path#1748
reubenwong97 wants to merge 2 commits intozizmorcore:mainfrom
reubenwong97:fix/missing-path

Conversation

@reubenwong97
Copy link
Copy Markdown
Contributor

Pre-submission checks

Please check these boxes:

If a checkbox is not applicable, you can leave it unchecked.

Summary

For the github format, uses the presentation path with prefix stripping instead of the sarif path.

Test Plan

Added snapshot integration tests for the scenarios described in the issue.

Closes #1745

@reubenwong97
Copy link
Copy Markdown
Contributor Author

Hi @woodruffw ,

Can you help to take a look at this? Thanks!

// gracefully.
let filepath = primary.symbolic.key.sarif_path();
let filepath = Utf8Path::new(primary.symbolic.key.presentation_path());
let filepath = filepath.strip_prefix(".").unwrap_or(filepath);
Copy link
Copy Markdown
Contributor

@Danil42Russia Danil42Russia Mar 11, 2026

Choose a reason for hiding this comment

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

Perhaps this should be moved to a higher level so that plain does not have the same issues:

🌈 zizmor v1.23.1
 INFO audit: zizmor: 🌈 completed ./.github/workflows/ci.yml
warning[excessive-permissions]: overly broad permissions
  --> ./.github/workflows/ci.yml:9:3

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

@woodruffw should we go ahead with this? If so would it be an amendment to the behavior of presentation_path?

@reubenwong97
Copy link
Copy Markdown
Contributor Author

Hi @woodruffw ,

Could you take a look at the discussion here when you have some time? Thanks!

@woodruffw
Copy link
Copy Markdown
Member

Yeah, I'll try and get to this in the next day or so.

@crazy-max
Copy link
Copy Markdown

crazy-max commented Mar 26, 2026

I think it should also be fixed for sarif format. Atm I don't have annotations shown on PRs with sarif format if I specify .github as input but works with root ..

Here I run zizmor twice with github and sarif formats with . input:

image

@reubenwong97
Copy link
Copy Markdown
Contributor Author

Thanks @crazy-max , this makes sense to me. I'll prepare a change and get @woodruffw 's input.

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 this pull request may close these issues.

[BUG]: Part of the path is missing when displayed in GitHub format

4 participants