Skip to content

ci(lint): align lint workflow with GitHub Actions best practices - #14780

Merged
iennae merged 2 commits into
mainfrom
fix/gha-zizmor-hardening
Nov 9, 2026
Merged

iennae merged 2 commits into
mainfrom
fix/gha-zizmor-hardening

Conversation

@iennae

@iennae iennae commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Tidies up .github/workflows/lint.yml to follow current GitHub Actions best practices. No change to what is linted.

  • Workflow-level permissions: {}; job-level contents: read only.
  • Added a per-PR concurrency group with cancel-in-progress so superseded runs are cancelled.
  • Named the job and added a 15 minute timeout-minutes.
  • Bumped actions/checkout to v7.0.1 and actions/setup-python to v7.1.0 (still pinned to full commit SHAs with exact version comments).
  • actions/checkout: set persist-credentials: false (the lint script only does read-only fetches).
  • Pass github.base_ref to the lint script through an env variable.
  • Removed trailing whitespace.

Validated with zizmor --persona=pedantic (no findings) and actionlint (clean).

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended. (Will be exercised by the Lint check on this PR once Actions run.)

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

The Lint workflow is out of step with current GitHub Actions
recommendations and the checks run by the GitHub Actions workflow
scanner, so it needs a tidy-up before it can be re-enabled.

Changes to .github/workflows/lint.yml:
- Set workflow-level `permissions: {}` and grant `contents: read`
  at the job level only.
- Add a `concurrency` group per PR with `cancel-in-progress` so
  superseded runs are cancelled.
- Give the job a descriptive name and a 15 minute timeout.
- Set `persist-credentials: false` on actions/checkout; the lint
  script only performs read-only fetches of the public repository.
- Correct the actions/checkout pin comment to the exact tag the SHA
  refers to (v6.0.3).
- Pass `github.base_ref` to the lint script via an environment
  variable instead of inline expression expansion.
- Remove trailing whitespace.

No functional change to what is linted. Verified with zizmor
(pedantic persona, no findings) and actionlint (clean).
@iennae
iennae requested review from a team as code owners November 9, 2026 18:24
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: workflows Issues related to the Workflows API. labels Nov 9, 2026
Comment thread .github/workflows/lint.yml Resolved
… v7.1.0

The lint workflow pinned actions/checkout v6.0.3 and
actions/setup-python v6.2.0; both have newer major releases.

- actions/checkout v7.0.1 (3d3c42e): ESM migration and dependency
  updates; new checks only affect pull_request_target/workflow_run,
  which this workflow does not use.
- actions/setup-python v7.1.0 (6d4fd22): ESM migration, dependency
  updates and removal of the unused pip-install input. Python 3.10
  remains available for all ubuntu-latest images.

Both remain pinned to full commit SHAs with exact version comments.
zizmor (pedantic) and actionlint report no findings.

@amcolin amcolin 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.

LGTM

@iennae
iennae merged commit f70bd51 into main Nov 9, 2026
14 checks passed
@iennae
iennae deleted the fix/gha-zizmor-hardening branch November 9, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: workflows Issues related to the Workflows API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants