Skip to content

ci: add zizmor for linting gha workflows#210

Closed
vitorfloriano wants to merge 1 commit into
kubernetes-sigs:mainfrom
vitorfloriano:ci-add-zizmor
Closed

ci: add zizmor for linting gha workflows#210
vitorfloriano wants to merge 1 commit into
kubernetes-sigs:mainfrom
vitorfloriano:ci-add-zizmor

Conversation

@vitorfloriano
Copy link
Copy Markdown
Contributor

@vitorfloriano vitorfloriano commented May 4, 2026

This PR adds Zizmor to CI.

In short, Zizmor is a Static Analysis Tool that scans GitHub Actions workflows to detect security issues like unpinned version usage, excessive permissions and many other issues.

It will help us ensure existent and added workflows adhere to security best practices, including Kubernetes new GitHub Actions Security Policy.

About the chosen config:

Blocked by #200

@netlify
Copy link
Copy Markdown

netlify Bot commented May 4, 2026

Deploy Preview for node-readiness-controller canceled.

Name Link
🔨 Latest commit a17c084
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6a02218c93486a0009d90596

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vitorfloriano
Once this PR has been reviewed and has the lgtm label, please assign sergeykanzhelev for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 4, 2026
@ajaysundark
Copy link
Copy Markdown
Contributor

/cc @Priyankasaggu11929

Could you help take a look at this? Thanks!

Comment thread .github/workflows/lint-workflows.yml Outdated
on:
pull_request:
paths:
- '**/workflows/*.yml'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could this be restricted to .github/workflows/** instead?

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.

Yeah, **/workflows/ works best for monorepos, but that's not the case here. I'll change that.

Comment thread .github/workflows/lint-workflows.yml Outdated
on:
pull_request:
paths:
- '**/workflows/*.yml'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could prefer path filter to be .github/workflows/**/*.{yml, yaml}

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.

I think GitHub Actions only recognizes the files directly under workflows/ (without additional nesting), so I believe it should be like this:

Suggested change
- '**/workflows/*.yml'
- '.github/workflows/*.{yml,yaml}'

See: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#about-yaml-syntax-for-workflows

You must store workflow files in the .github/workflows directory of your repository.

I'll update based on that.

@ajaysundark
Copy link
Copy Markdown
Contributor

/assign @vitorfloriano

@vitorfloriano
Copy link
Copy Markdown
Contributor Author

Hm...the workflow linter did not run after the latest change. Need to investigate.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2026
Comment on lines +5 to +6
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'
Copy link
Copy Markdown
Contributor Author

@vitorfloriano vitorfloriano May 11, 2026

Choose a reason for hiding this comment

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

@ajaysundark Apparently, *.{yml, yaml} isn't valid syntax in workflows, so we'll need to be a bit redundant explicit here.

See: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#filter-pattern-cheat-sheet

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2026
@Priyankasaggu11929
Copy link
Copy Markdown
Member

Folks, just a thought - rather than introducing more new tools to ensure our GH actions are safe, could we try moving our existing GitHub Action workflows to Prow (I can help guide here)?

@Priyankasaggu11929
Copy link
Copy Markdown
Member

Folks, just a thought - rather than introducing more new tools to ensure our GH actions are safe, could we try moving our existing GitHub Action workflows to Prow (I can help guide here)?

Hello @vitorfloriano, following up from our discussion from yesterday's call.

For learning about Prow/Prowjobs, here are some resources:


We already have a directory setup for defining Prow jobs for the Node Readiness Controller (NRC) repo here - https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-sigs/node-readiness-controller

This is the PR that added the first (presubmit) job for the NRC project - kubernetes/test-infra#36261.
The review comments might be helpful.


And for some guidance/reference on migrating our existing NRC GH action worfklow jobs, we can maybe look at the prow jobs definition for NPD project - https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes/node-problem-detector

We can start by migrating one of the GH jobs to Prow.
Please feel free to start a draft PR and use that for any queries/doubts, I can help. Thanks!

@vitorfloriano
Copy link
Copy Markdown
Contributor Author

We can start by migrating one of the GH jobs to Prow.
Please feel free to start a draft PR and use that for any queries/doubts, I can help. Thanks!

@Priyankasaggu11929 I drafted kubernetes/test-infra#37035.

I decided to start with migrating the test workflow because it seems to be the easiest.

Also, I think that migrating the release workflow would enter the scope of the upcoming mentorship project (see #151), so I'll leave it for now.

Considering we are moving towards a Prow-centered CI, I'll close this PR.

We can continue the conversation on the prowjob PR and in future meetings.

Thanks for the guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants