Skip to content

Harden GitHub Actions execution and improve workflows#150

Open
roark47 wants to merge 7 commits into
mainfrom
codex/harden-github-actions
Open

Harden GitHub Actions execution and improve workflows#150
roark47 wants to merge 7 commits into
mainfrom
codex/harden-github-actions

Conversation

@roark47

@roark47 roark47 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

This pull request makes significant improvements to CI/CD security, reliability, and maintainability by updating workflow configurations, permissions, and dependency management. The main changes include switching most jobs from persistent self-hosted runners to ephemeral GitHub-hosted runners, tightening job permissions, improving dependency pinning, and enhancing secret handling. There are also updates to code ownership and Dependabot configuration.

CI/CD Workflow Hardening and Improvements

  • All primary workflows (ci.yml, codeql.yml, docs.yml, extended-ci.yml) now default to using GitHub-hosted runners (e.g., ubuntu-24.04, windows-2025) for untrusted or PR code, reducing risk from untrusted code execution. Only trusted jobs use self-hosted runners with required labels. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Workflow job permissions are now minimized (permissions: {} globally, with jobs opting into only what they need), following the principle of least privilege. [1] [2] [3] [4]
  • All third-party GitHub Actions are now version-pinned by commit SHA for supply-chain security. [1] [2] [3] [4] [5] [6]
  • set -euo pipefail is added to shell steps for more robust error handling. [1] [2] [3] [4] [5] [6] [7] [8]
  • Secret checks for required API keys now fail the job early with clear errors, instead of silently skipping tests. [1] [2]

Dependency and Toolchain Management

  • All CLI tool installations in extended-ci.yml are now pinned to specific versions for reproducibility and reliability. [1] [2]
  • Dependabot is configured to update documentation (npm) and Docker dependencies, with grouping and labeling for easier review.

Code Ownership and Runner Labeling

  • Code ownership is clarified for workflow files, dependabot.yml, and the action source.
  • Custom runner labels are documented in actionlint.yaml for self-hosted runners.

Other Notable Improvements

  • Concurrency groups and cancellation logic are improved for workflows to avoid unnecessary duplicate runs. [1] [2]
  • The .github/CODEOWNERS file is updated to reflect recommended rulesets and stable checks.

These changes collectively make the CI/CD pipeline more secure, maintainable, and reliable, and ensure best practices are followed for dependency and secret management.

@roark47
roark47 requested review from Copilot and zpzjzj July 23, 2026 03:37
@roark47 roark47 self-assigned this Jul 23, 2026
@roark47
roark47 requested a review from hittyt as a code owner July 23, 2026 03:37
@roark47 roark47 added the chore label Jul 23, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread .github/dependabot.yml Fixed
Comment thread .github/dependabot.yml Fixed
Comment thread .github/workflows/extended-ci.yml Fixed

Copilot AI left a comment

Copy link
Copy Markdown

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 and GitHub Action supply chain by moving untrusted execution onto GitHub-hosted runners, minimizing permissions, pinning third-party dependencies (actions, images, installers), and documenting operational runbooks for maintainers.

Changes:

  • Tighten workflow security posture (least-privilege permissions, SHA-pinned actions, improved concurrency, safer shell defaults, and clearer secret handling).
  • Improve action/runtime supply-chain integrity (digest-pinned runner image, version-pinned tools, and checksum-verified installer download paths).
  • Add maintainer documentation plus ownership/dependency automation updates (CI maintenance runbook, CODEOWNERS, Dependabot, actionlint labels).

Reviewed changes

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

Show a summary per file
File Description
docs/zh/guide/ci-maintenance.md Adds Chinese CI maintenance runbook covering trust boundaries, required checks, secrets/environments, and incident guidance.
docs/guide/ci-maintenance.md Adds English CI maintenance runbook aligning repo settings with hardened workflows.
docs/.vitepress/config.ts Adds “Maintainers/维护者” nav entries linking to the new CI maintenance docs.
action/main.py Pins installer source + validates installer checksum before execution; pins default skill-up version.
action/entry.sh Hardens shell execution (-euo pipefail) and makes workspace permission restoration fail loudly.
action/Dockerfile Pins base image by digest; pins tool versions; replaces mutable installers with checksum-verified artifacts; adds OCI labels.
action.yml Pins default skill-up version and pins runner image by digest.
.github/workflows/workflow-security.yml Introduces a workflow to scan workflows with Zizmor using least-privilege permissions.
.github/workflows/skill-upper-self-eval.yml Tightens permissions, runner labeling, secret handling, and avoids copying secrets via step outputs.
.github/workflows/runner-image.yml Hardens image publishing workflow (permissions, tag validation, build metadata, SBOM/provenance, digest recording).
.github/workflows/release.yml Adds concurrency + release tag validation; tightens permissions and runner labeling; pins GoReleaser version.
.github/workflows/extended-ci.yml Moves untrusted Windows E2E to GitHub-hosted; pins tool installs; hard-fails on missing required secrets; pins Docker images by digest.
.github/workflows/docs.yml Adds PR docs builds on GitHub-hosted runners; restricts deploy steps/permissions to non-PR events.
.github/workflows/codeql.yml Moves CodeQL to GitHub-hosted runners; pins actions; adds merge_group; tightens permissions and shell robustness.
.github/workflows/ci.yml Adds merge_group; moves core CI jobs to GitHub-hosted runners; minimizes permissions; improves concurrency semantics.
.github/dependabot.yml Adds npm + Docker Dependabot updates with grouping/labels for easier review.
.github/CODEOWNERS Updates guidance and expands ownership coverage for workflows/action/dependabot.
.github/actionlint.yaml Documents self-hosted runner custom labels for actionlint validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action/main.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f450ef80d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/docs.yml
Comment thread .github/workflows/model-e2e.yml Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants