Skip to content

🌱 harden git workflows#6331

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
PrashantR30:main
Jun 2, 2026
Merged

🌱 harden git workflows#6331
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
PrashantR30:main

Conversation

@PrashantR30
Copy link
Copy Markdown
Contributor

@PrashantR30 PrashantR30 commented Jun 2, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR hardens GitHub Actions workflows by aligning them with current GitHub Actions security best practices and similar hardening changes already applied across other Cluster API providers.

The changes include:

  • Adding persist-credentials: false to actions/checkout steps where repository write access is not required.
  • Ensuring workflows follow the principle of least privilege.

These changes reduce the risk of credential misuse from workflow execution while preserving existing CI/CD functionality.

Which issue(s) this PR fixes (optional, in fixes #<issue number> format):

Fixes #

Special notes for your reviewer:

This PR mirrors workflow hardening changes previously adopted in Cluster API Provider AWS and applies the same security posture to CAPZ workflows.

No functional changes to Cluster API Provider Azure components are expected. The changes are limited to GitHub Actions workflow configuration and credential handling.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

Harden GitHub Actions workflows by disabling persisted checkout credentials and reducing unnecessary workflow permissions.

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 2, 2026
@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @PrashantR30!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @PrashantR30. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 2, 2026
@k8s-ci-robot k8s-ci-robot requested review from bryan-cox and nojnhuh June 2, 2026 10:57
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 2, 2026
@PrashantR30 PrashantR30 changed the title harden git workflows 🌱 harden git workflows Jun 2, 2026
@bryan-cox
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2026
@bryan-cox
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: fa8dc36fabf544c28aab0601ff164a823849b1aa

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.95%. Comparing base (b10eeb5) to head (f2e0687).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6331   +/-   ##
=======================================
  Coverage   43.95%   43.95%           
=======================================
  Files         288      288           
  Lines       25285    25285           
=======================================
  Hits        11114    11114           
  Misses      13398    13398           
  Partials      773      773           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

Thanks for this! I had a couple comments, and also the PR description mentions a couple items that don't seem to be part of this PR:

  • "Reducing the exposure of the default GITHUB_TOKEN"
  • "Removing unnecessary pull request trigger types"

I assume you've been doing this across other CAPI-related projects (and if so, thanks!) but that they weren't relevant to CAPZ. If so, let's remove them from the PR description.

Comment thread .github/workflows/dependabot-code-gen.yml Outdated
Comment thread .github/workflows/pr-golangci-lint.yaml Outdated
@github-project-automation github-project-automation Bot moved this from Todo to Wait-On-Author in CAPZ Planning Jun 2, 2026
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2026
Copy link
Copy Markdown
Contributor

@mboersma mboersma left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 2, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 8c3bdfe1ae863115df0b8299386d02afdc14117a

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mboersma

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2026
@k8s-ci-robot k8s-ci-robot merged commit 1513e1d into kubernetes-sigs:main Jun 2, 2026
20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Jun 2, 2026
@github-project-automation github-project-automation Bot moved this from Wait-On-Author to Done in CAPZ Planning Jun 2, 2026
@mboersma
Copy link
Copy Markdown
Contributor

mboersma commented Jun 2, 2026

/cherry-pick release-1.24

@mboersma
Copy link
Copy Markdown
Contributor

mboersma commented Jun 2, 2026

/cherry-pick release-1.23

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: new pull request created: #6335

Details

In response to this:

/cherry-pick release-1.24

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-infra-cherrypick-robot
Copy link
Copy Markdown

@mboersma: new pull request created: #6336

Details

In response to this:

/cherry-pick release-1.23

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants