Skip to content

feat: new audit: stale-action-refs - #713

Merged
woodruffw merged 4 commits into
zizmorcore:mainfrom
Marcono1234:audit-stale-refs
Apr 30, 2025
Merged

woodruffw merged 4 commits into
zizmorcore:mainfrom
Marcono1234:audit-stale-refs

Conversation

@Marcono1234

Copy link
Copy Markdown
Contributor

Resolves #689

Comment thread tests/integration/common.rs Resolved
Comment thread docs/release-notes.md Resolved
@Marcono1234
Marcono1234 marked this pull request as ready for review April 29, 2025 15:32
@woodruffw

Copy link
Copy Markdown
Member

Nice, thank you @Marcono1234! This looks great from a very quick initial pass; I'll do a more detailed review tonight.

Comment thread docs/audits.md
Comment on lines +1342 to +1344
Some action repositories use a "rolling release branch" strategy where
all commits on a certain branch are considered releases. In such a case
findings of this audit can likely be ignored.

@woodruffw woodruffw Apr 29, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was thinking about this a bit, and I think we could detect this scenario by looking up the SHA ref, and then seeing whether it belongs to a branch other that the default one. But that's likely to expensive in terms of API calls and slow, so I'm OK with not doing it for now.

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.

It could also lead to false negatives when that branch is not a rolling release branch, but instead some work-in-progress branch containing bugs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

True. There's probably no good general solution here, then.

Comment thread src/audit/stale_action_refs.rs Outdated
Comment on lines +31 to +37
.with_context(|| {
format!(
"couldn't retrieve tag for {owner}/{repo}@{commit_ref}",
owner = uses.owner,
repo = uses.repo
)
})?,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: this is a great context message to add, but it's so good that it makes me realize that it should be in longest_tag_for_commit itself 🙂 -- could you move it there?

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 compliment, but I just copied the message from src/audit/known_vulnerable_actions.rs, and you were the one who added it there originally 😅

The with_context call there is now probably redundant; have created #729 to remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤦

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @Marcono1234, this is excellent! Only one tiny nitpick.

(Thinking out loud: I think we'll want to put the "mismatching comment" check under this same audit name, but that's not something that needs to be tackled in this PR at all.)

Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw
woodruffw enabled auto-merge (squash) April 30, 2025 03:05
@woodruffw woodruffw added this to the 1.7.0 milestone Apr 30, 2025
@woodruffw
woodruffw merged commit ebca08d into zizmorcore:main Apr 30, 2025
@Marcono1234
Marcono1234 deleted the audit-stale-refs branch April 30, 2025 18:31
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.

2 participants