Skip to content

Add actionlint checks for GitHub 操作 - #16316

Open
AlexWaygood wants to merge 6 commits into
mainfrom
alex/more-linters
Open

Add actionlint checks for GitHub 操作#16316
AlexWaygood wants to merge 6 commits into
mainfrom
alex/more-linters

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Aug 28, 2026

Copy link
Copy Markdown
Member

Add actionlint with ShellCheck to catch workflow syntax and shell-script errors, and update the existing workflows to pass the new checks.

The findings in tests.yml, daily.yml, stubtest_third_party.yml, and mypy_primer.yml came from actionlint's ShellCheck integration:

  • SC2086: unquoted variable expansions. Package and stub lists relied on implicit word splitting and were also subject to filename expansion; scalar values such as $GITHUB_SHA, $MYPY_VERSION, $GITHUB_ENV, and $GITHUB_PATH were unquoted too. The PR quotes scalar values and passes lists through quoted array expansions. Package requirements are read one line at a time, preserving spaces and wildcard characters within each requirement; the array-building loops also work with macOS's Bash 3.2.
  • SC2059: variable content in printf format strings; SC2001: unnecessary sed substitutions. Package logging used echo | sed to build an indented list and interpolated it into the format string, where % or backslashes in package names could be interpreted by printf. The PR prints each array element with the fixed format printf ' %s\n', removing the echo | sed pipeline.
  • SC2162: read without -r. The loop collecting changed stubs could interpret backslashes in its input. It now uses IFS= read -r to read each line literally.
  • SC2196: deprecated egrep. The changed-stub filter now uses grep -E instead.

The pre-commit hook hit pre-commit.ci's 180-second timeout, so actionlint runs in a dedicated GitHub 操作 workflow using its official prebuilt Docker image, which includes ShellCheck.

Stacked on #16314.

@AlexWaygood AlexWaygood added the project: infrastructure typeshed build, test, documentation, or distribution related label Aug 28, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@AlexWaygood

Copy link
Copy Markdown
Member Author

Example of what a failing run looks like: https://github.com/python/typeshed/actions/runs/33195282726/job/98930729363?pr=16316

@github-actions

This comment has been minimized.

@AlexWaygood
AlexWaygood marked this pull request as ready for review August 28, 2026 17:43
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Base automatically changed from alex/zizmor to main August 29, 2026 13:03
Comment thread .github/workflows/actionlint.yml Outdated
@AlexWaygood

Copy link
Copy Markdown
Member Author

(I updated the PR description with details of exactly what's being fixed here)

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

project: infrastructure typeshed build, test, documentation, or distribution related

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant