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

webhook: check for non-.sts.yaml files in .github/chainguard #586

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

imjasonh
Copy link
Contributor

@imjasonh imjasonh commented Nov 5, 2024

An easy way to mess up Octo STS is to create a policy file named like .github/chainguard/my-policy.yaml (ask me how I know! 😆)

Webhook validation currently only validates the structure of valid policy file paths, but it will happily let you commit non-STS file paths, which cause problems later when you try to use my-policy.

This may break existing repos using Octo STS, but I'd guess that if they have a my-policy.yaml they won't also have a valid my-policy.sts.yaml, so any breakage would probably be highlighting a real issue. In any case, if that's a problem, we can make this a warning instead of a failing check, if we want to.

Signed-off-by: Jason Hall <jason@chainguard.dev>
@imjasonh imjasonh changed the title webhook: check for non-.sts.yaml files in .github/chainguard webhook: check for non-.sts.yaml files in .github/chainguard Nov 5, 2024
@imjasonh imjasonh changed the title webhook: check for non-.sts.yaml files in .github/chainguard webhook: check for non-.sts.yaml files in .github/chainguard Nov 5, 2024
pkg/webhook/webhook.go Outdated Show resolved Hide resolved
Signed-off-by: Jason Hall <jason@chainguard.dev>
pkg/webhook/webhook.go Outdated Show resolved Hide resolved
cpanato
cpanato previously approved these changes Nov 5, 2024
Copy link
Collaborator

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

lgtm

@cpanato cpanato requested a review from mattmoor November 5, 2024 17:10
@mepi262
Copy link

mepi262 commented Dec 5, 2024

@imjasonh
It seems that this pull request has conflicts.
Would you resolve it?

tcnghia
tcnghia previously approved these changes Jan 31, 2025
Signed-off-by: Jason Hall <jason@chainguard.dev>
Signed-off-by: Jason Hall <jason@chainguard.dev>
Signed-off-by: Jason Hall <jason@chainguard.dev>
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.

6 participants