-
-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add static checks workflow for #320 phase C #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
daea401
chore: add static checks workflow for #320 phase C
mrlunchbox777 2c965bb
fix: use workflow file globs compatible with action-validator
mrlunchbox777 c238d50
fix: split zsh checks from shellcheck and shfmt
mrlunchbox777 e549196
docs: add response option framing guidance and bump 0.1.24
mrlunchbox777 03cab5b
docs: align bump policy and docs-bump cadence
mrlunchbox777 aca5f11
fix: stabilize static-check rollout for bash files
mrlunchbox777 5ef8d8e
docs: tighten merge-conflict/version guardrails and bump 0.1.26 entry
mrlunchbox777 24aa7a3
refactor(ci): centralize static-check shell file selection
mrlunchbox777 f4ab53a
fix(ci/docs): address review nits for static-checks and metadata
mrlunchbox777 cdd03b0
refactor(ci): simplify static-check file discovery and exclusion reuse
mrlunchbox777 2d50f68
fix(ci): exclude basic-setup.sh from sh static checks
mrlunchbox777 a7ec8ae
Potential fix for pull request finding
mrlunchbox777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Static Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "**/*.sh" | ||
| - "**/*.bash" | ||
| - "**/*.zsh" | ||
| - ".github/workflows/*.yml" | ||
| - ".github/workflows/*.yaml" | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "**/*.sh" | ||
| - "**/*.bash" | ||
| - "**/*.zsh" | ||
| - ".github/workflows/*.yml" | ||
| - ".github/workflows/*.yaml" | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| shell-static: | ||
| name: Shell static checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install shellcheck, shfmt, and zsh | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y shellcheck shfmt zsh | ||
|
|
||
| - name: Collect shell file lists | ||
| id: shell-files | ||
| run: | | ||
| # Temporary exclusion: basic-setup.sh declares sh shebang but uses bash-specific syntax. | ||
|
mrlunchbox777 marked this conversation as resolved.
|
||
| # TODO: Align basic-setup.sh with its shebang (or switch it to bash) and remove this exclusion so it is covered by shell checks again. | ||
| mapfile -t sh_files < <(git ls-files '*.sh' | grep -v '^basic-setup\.sh$' || true) | ||
| mapfile -t bash_all < <(git ls-files '*.bash' || true) | ||
| mapfile -t zsh_files < <(git ls-files '*.zsh' || true) | ||
|
|
||
| # Temporary exclusions for legacy/bash completion files pending dedicated cleanup. | ||
| mapfile -t shellcheck_bash_files < <( | ||
| printf '%s\n' "${bash_all[@]}" | | ||
| grep -v '^alias/bash/git-prompt.bash$' | | ||
| grep -v '^alias/bash/kubectl-completion.bash$' || true | ||
| ) | ||
|
|
||
| # Keep shfmt exclusions aligned with shellcheck for consistency. | ||
| mapfile -t shfmt_bash_files < <(printf '%s\n' "${shellcheck_bash_files[@]}" || true) | ||
|
|
||
| { | ||
| echo "sh_files<<EOF" | ||
| printf '%s\n' "${sh_files[@]}" | ||
| echo "EOF" | ||
| echo "shellcheck_bash_files<<EOF" | ||
| printf '%s\n' "${shellcheck_bash_files[@]}" | ||
| echo "EOF" | ||
| echo "shfmt_bash_files<<EOF" | ||
| printf '%s\n' "${shfmt_bash_files[@]}" | ||
| echo "EOF" | ||
| echo "zsh_files<<EOF" | ||
| printf '%s\n' "${zsh_files[@]}" | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Run shellcheck | ||
| run: | | ||
| mapfile -t sh_files <<< "${{ steps.shell-files.outputs.sh_files }}" | ||
| mapfile -t bash_files <<< "${{ steps.shell-files.outputs.shellcheck_bash_files }}" | ||
| if [ "${#sh_files[@]}" -eq 0 ] && [ "${#bash_files[@]}" -eq 0 ]; then | ||
| echo "No sh/bash files found" | ||
| exit 0 | ||
| fi | ||
|
mrlunchbox777 marked this conversation as resolved.
|
||
| if [ "${#sh_files[@]}" -gt 0 ] && [ -n "${sh_files[0]}" ]; then | ||
| shellcheck "${sh_files[@]}" | ||
| fi | ||
| if [ "${#bash_files[@]}" -gt 0 ] && [ -n "${bash_files[0]}" ]; then | ||
| shellcheck -s bash "${bash_files[@]}" | ||
| fi | ||
|
|
||
| - name: Run shfmt diff check | ||
| run: | | ||
| mapfile -t sh_files <<< "${{ steps.shell-files.outputs.sh_files }}" | ||
| mapfile -t bash_files <<< "${{ steps.shell-files.outputs.shfmt_bash_files }}" | ||
| if [ "${#sh_files[@]}" -eq 0 ] && [ "${#bash_files[@]}" -eq 0 ]; then | ||
| echo "No sh/bash files found" | ||
| exit 0 | ||
| fi | ||
| if [ "${#sh_files[@]}" -gt 0 ] && [ -n "${sh_files[0]}" ]; then | ||
| shfmt -d "${sh_files[@]}" | ||
| fi | ||
| if [ "${#bash_files[@]}" -gt 0 ] && [ -n "${bash_files[0]}" ]; then | ||
| shfmt -d "${bash_files[@]}" | ||
| fi | ||
|
|
||
| - name: Run zsh syntax check | ||
| run: | | ||
| mapfile -t zsh_files <<< "${{ steps.shell-files.outputs.zsh_files }}" | ||
| if [ "${#zsh_files[@]}" -eq 0 ] || [ -z "${zsh_files[0]}" ]; then | ||
| echo "No zsh files found" | ||
| exit 0 | ||
| fi | ||
| zsh -n "${zsh_files[@]}" | ||
|
|
||
| actionlint: | ||
| name: actionlint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Run actionlint | ||
| uses: rhysd/actionlint@v1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # BasicSetupCliVersion - constant for semantic versioning | ||
| BasicSetupCliVersion: "0.1.25" | ||
| BasicSetupCliVersion: "0.1.26" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # BasicSetupCliVersion - primary version source for releases and docs bump automation | ||
| BasicSetupCliVersion: "0.1.25" | ||
| BasicSetupCliVersion: "0.1.26" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.