Skip to content

chore: secure github workflows - #393

Merged
volcano-sh-bot merged 1 commit into
volcano-sh:mainfrom
safiya2610:secure-workflows
Jul 3, 2026
Merged

volcano-sh-bot merged 1 commit into
volcano-sh:mainfrom
safiya2610:secure-workflows

Conversation

@safiya2610

@safiya2610 safiya2610 commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind security /kind cleanup

What this PR does / why we need it:

This PR hardens our CI/CD infrastructure and aligns our GitHub Workflows with GitHub Security Best Practices. Specifically, it introduces the following enhancements:

Pin Actions to Full-Length Commit SHAs:

Replaced mutable action tags (e.g., @v4) with immutable 40-character commit SHAs across all 14 workflow files to protect against tag-moving or hijacking.
Define Top-Level Permissions: Added explicit top-level permissions (permissions: contents: read) to workflows that lacked them, enforcing the Principle of Least Privilege.
Standardize Action Versions: Unified action versions across all workflows (e.g., standardizing on actions/setup-go@v5 and actions/setup-python@v5).
Configure Dependabot: Added a .github/dependabot.yml configuration to automatically track and update our pinned GitHub Actions on a weekly schedule.

Which issue(s) this PR fixes:

Fixes #392

Special notes for your reviewer:

The IMAGE_REGISTRY utilizes a dynamically formatted environment variable generated directly within the workflow via $GITHUB_ENV, so no manual UI setup is needed for that. The release workflows (dify-plugin-publish.yml and python-cli-publish.yml) will continue to require the pypi environment and PLUGIN_ACTION secret configured by maintainers at the repository level.

Copilot AI review requested due to automatic review settings June 18, 2026 16:45
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

@safiya2610: The label(s) kind/security, kind//kind cannot be applied, because the repository doesn't have them.

Details

In response to this:

What type of PR is this?

/kind security /kind cleanup

What this PR does / why we need it:

This PR hardens our CI/CD infrastructure and aligns our GitHub Workflows with GitHub Security Best Practices. Specifically, it introduces the following enhancements:

Pin Actions to Full-Length Commit SHAs:

Replaced mutable action tags (e.g., @v4) with immutable 40-character commit SHAs across all 14 workflow files to protect against tag-moving or hijacking.
Define Top-Level Permissions: Added explicit top-level permissions (permissions: contents: read) to workflows that lacked them, enforcing the Principle of Least Privilege.
Standardize Action Versions: Unified action versions across all workflows (e.g., standardizing on actions/setup-go@v5 and actions/setup-python@v5).
Configure Dependabot: Added a .github/dependabot.yml configuration to automatically track and update our pinned GitHub Actions on a weekly schedule.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

The IMAGE_REGISTRY utilizes a dynamically formatted environment variable generated directly within the workflow via $GITHUB_ENV, so no manual UI setup is needed for that. The release workflows (dify-plugin-publish.yml and python-cli-publish.yml) will continue to require the pypi environment and PLUGIN_ACTION secret configured by maintainers at the repository level.

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/test-infra repository.

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

Welcome @safiya2610! It looks like this is your first PR to volcano-sh/agentcube 🎉

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds a Dependabot configuration file to schedule weekly updates for GitHub Actions. The feedback suggests grouping these updates into a single weekly pull request using Dependabot's groups feature to avoid PR fatigue.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .github/dependabot.yml Resolved

Copilot AI left a comment

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.

Pull request overview

This PR hardens the repository’s CI/CD GitHub Actions setup by pinning third-party actions to immutable commit SHAs, setting explicit least-privilege workflow permissions, and adding Dependabot tracking for GitHub Actions updates.

Changes:

  • Pinned GitHub Actions uses: references from mutable tags to full-length commit SHAs across all workflows.
  • Added explicit top-level permissions blocks (generally contents: read) to align with least-privilege defaults.
  • Added .github/dependabot.yml to keep pinned GitHub Actions up to date on a weekly cadence.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/workflows-approve.yml Pins actions/github-script; workflow uses pull_request_target with explicit permissions.
.github/workflows/test-coverage.yml Adds top-level permissions and pins checkout/paths-filter/setup-go/codecov/upload-artifact actions.
.github/workflows/python-sdk-tests.yml Adds top-level permissions and pins checkout/paths-filter/setup-python.
.github/workflows/python-sdk-publish.yml Adds top-level permissions and pins checkout/setup-python/pypi-publish.
.github/workflows/python-lint.yml Adds top-level permissions and pins checkout/paths-filter/setup-python.
.github/workflows/python-cli-publish.yml Adds top-level permissions and pins checkout/setup-python/pypi-publish.
.github/workflows/main.yml Adds top-level permissions and pins checkout/docker buildx setup.
.github/workflows/lint.yml Pins checkout/paths-filter/setup-go.
.github/workflows/e2e.yml Adds top-level permissions and pins checkout/setup-python/setup-go/kind/upload-artifact.
.github/workflows/dify-plugin-publish.yml Adds top-level permissions and pins checkout usages.
.github/workflows/copyright-check.yml Adds top-level permissions and pins checkout/paths-filter.
.github/workflows/codespell.yml Adds top-level permissions and pins checkout.
.github/workflows/codegen-check.yml Adds top-level permissions and pins checkout/paths-filter/setup-go.
.github/workflows/build-push-release.yml Adds top-level permissions and pins checkout/setup-go/docker/buildx/helm/login actions.
.github/dependabot.yml Adds weekly Dependabot updates for the github-actions ecosystem.

Comment thread .github/workflows/test-coverage.yml Resolved
Comment thread .github/workflows/python-sdk-tests.yml Resolved
Comment thread .github/workflows/python-lint.yml Resolved
Comment thread .github/workflows/codegen-check.yml Resolved
Comment thread .github/workflows/copyright-check.yml Resolved
Comment thread .github/workflows/workflows-approve.yml Resolved
@codecov-commenter

codecov-commenter commented Jun 18, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.56%. Comparing base (524e55e) to head (1aaa378).
⚠️ Report is 154 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #393       +/-   ##
===========================================
+ Coverage   47.57%   58.56%   +10.99%     
===========================================
  Files          30       36        +6     
  Lines        2819     3463      +644     
===========================================
+ Hits         1341     2028      +687     
+ Misses       1338     1227      -111     
- Partials      140      208       +68     
Flag Coverage Δ
unittests 58.56% <ø> (+10.99%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

@safiya2610
safiya2610 force-pushed the secure-workflows branch 3 times, most recently from 9ae5900 to 766d0cf Compare June 18, 2026 17:43

@zhzhuang-zju zhzhuang-zju left a comment

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.

Thanks @safiya2610

Comment thread .github/dependabot.yml Resolved
Copilot AI review requested due to automatic review settings June 22, 2026 07:19

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

vanshika2720 added a commit to vanshika2720/agentcube that referenced this pull request Jun 22, 2026
go.mod pins golang.org/x/oauth2 at v0.32.0 (an indirect dependency via
github.com/coreos/go-oidc/v3). A stale v0.36.0 checksum pair was
introduced in commit e49e608 when the OIDC feature was merged without
running go mod tidy beforehand.

The codegen-check CI job executes 'make gen-check', which internally
runs 'go mod tidy' (via the generate target) and then checks
'git diff --exit-code'. Because go mod tidy removes the unreachable
v0.36.0 entry, the working tree is always dirty after code generation,
causing the check to fail with exit code 1.

This commit applies 'go mod tidy' to bring go.sum back in sync with
go.mod. No dependencies are added or changed; only the stale v0.36.0
checksum entries are removed.

Fixes the Codegen Check CI failure that blocks PR volcano-sh#393.

Signed-off-by: Vanshika <[email protected]>
@zhzhuang-zju

zhzhuang-zju commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

hello, Codegen check is failing, not because of my code,
the go.sum file have extra dependency (golang.org/x/oauth2 v0.36.0),our dependency tree only requires v0.32.0 (as specified in go.mod). That's why I run the go mod tidy command.

@safiya2610 Sorry, I didn't quite catch that. Could you share the link to the failed CI run?

I see what's going on. I'll create a separate issue to track this problem.

@safiya2610

Copy link
Copy Markdown
Contributor Author

hello, Codegen check is failing, not because of my code,
the go.sum file have extra dependency (golang.org/x/oauth2 v0.36.0),our dependency tree only requires v0.32.0 (as specified in go.mod). That's why I run the go mod tidy command.

@safiya2610 Sorry, I didn't quite catch that. Could you share the link to the failed CI run?

I see what's going on. I'll create a separate issue to track this problem.

I have solve this.

@zhzhuang-zju

Copy link
Copy Markdown
Contributor

I have solve this.

Yes, I noticed your commit removes extra entries from go.sum. However, this does not fully resolve the issue. As I mentioned in issue #401, we also need to fix the Codegen Check CI to prevent the same problem from recurring.

Since this is out of scope for the current PR, we can rebase after #399 gets merged.

@zhzhuang-zju zhzhuang-zju left a comment

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.

Well done! @safiya2610
We need to wait for #399 to be merged and then rebase, others LGTM.

Comment thread .github/workflows/test-coverage.yml Resolved
Comment thread .github/workflows/workflows-approve.yml Resolved
Comment thread .github/workflows/codegen-check.yml Resolved
Copilot AI review requested due to automatic review settings June 23, 2026 10:12

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

@zhzhuang-zju

Copy link
Copy Markdown
Contributor

Hi @safiya2610, please make sure to squash your commits after making changes to make sure the PR is ready to be merged.

@safiya2610

safiya2610 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @safiya2610, please make sure to squash your commits after making changes to make sure the PR is ready to be merged.

sure I will squash all commits. doing..

Copilot AI review requested due to automatic review settings July 2, 2026 09:25

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/workflows-approve.yml Resolved
Copilot AI review requested due to automatic review settings July 2, 2026 09:56

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

- Pin GitHub Actions to full-length commit SHAs.
- Add explicit workflow permissions following the principle of least privilege.
- Configure Codegen Check to run for all pull requests.
- Update workflows-approve permissions.

Co-authored-by: zhzhuang-zju <[email protected]>
Signed-off-by: Safiya <[email protected]>
@safiya2610

Copy link
Copy Markdown
Contributor Author

@zhzhuang-zju Please check, everything is done.

@zhzhuang-zju zhzhuang-zju left a comment

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.

Thanks, others LGTM

runs-on: ubuntu-latest
permissions:
actions: write
pull-requests: read

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.

Suggested change
pull-requests: read

I noticed that Copilot proposed adding pull-requests: read, but since this workflow previously functioned correctly without that permission, we can postpone adding it.

@RainbowMango RainbowMango left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks.

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: RainbowMango

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

@volcano-sh-bot
volcano-sh-bot merged commit 7f5a730 into volcano-sh:main Jul 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Umbrella][Infrastructure] Hardening GitHub Workflows

6 participants