Add shellcheck GitHub Action with annotations for .sh files#6622
Add shellcheck GitHub Action with annotations for .sh files#6622
Conversation
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
danieljurek
left a comment
There was a problem hiding this comment.
Make a note of things you learn from this PR iteration in the appropriate instructions file targeting .github/workflows/*.yml
.github/workflows/shellcheck.yml
Outdated
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Run ShellCheck | ||
| uses: reviewdog/action-shellcheck@v1 |
There was a problem hiding this comment.
Do not use 3rd party actions
There was a problem hiding this comment.
Replaced reviewdog/action-shellcheck with native shellcheck implementation using GitHub problem matchers. The workflow now uses shellcheck directly (pre-installed on ubuntu-latest) with a custom problem matcher at .github/shellcheck-matcher.json for annotations. Commit: 5525c13
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
Created
Commit: 5525c13 |
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
.github/workflows/shellcheck.yml
Outdated
| find . -name "*.sh" -type f \ | ||
| -not -path "*/.*" \ | ||
| -not -path "*/node_modules/*" \ | ||
| -not -path "*/vendor/*" \ | ||
| -exec shellcheck -f gcc {} + |
There was a problem hiding this comment.
Look over changed .sh files instead of checking all files. I don't want this blocking unrelated PRs.
There was a problem hiding this comment.
Updated workflow to check only changed shell scripts using git diff. The workflow now:
- Uses
fetch-depth: 0to enable git history comparison - Gets changed
.shfiles viagit diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD - Skips shellcheck entirely if no shell scripts were changed
- Won't block PRs due to pre-existing issues in unrelated scripts
Commit: f9376b2
Co-authored-by: danieljurek <2158838+danieljurek@users.noreply.github.com>
|
Hi @@copilot. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Hi @@copilot. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass. |
Adds automated shellcheck linting on PRs that modify shell scripts, surfacing errors as GitHub Actions annotations using native problem matchers.
Changes
New workflow:
.github/workflows/shellcheck.yml.shfile changes, workflow changes, or problem matcher changes in PRs to maingit diffto avoid blocking unrelated PRsfetch-depth: 0for full git history to enable diff comparisonProblem Matcher:
.github/shellcheck-matcher.jsonDocumentation:
.github/agents/github-workflows.agent.mdImplementation Details
actions/checkout@v4per repository policycontents: readrequiredgit diff --name-only --diff-filter=ACMRTOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.