Fix ShellCheck CI false positives and harden ShellCheck workflow permissions#93
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/openSUSE/opensuse-migration-tool/sessions/2160a6d9-25ce-4eef-9a68-cc0c48521453 Co-authored-by: lkocman <510119+lkocman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job shellcheck
Fix ShellCheck CI false positives for May 17, 2026
/etc/os-release variables
lkocman
approved these changes
May 17, 2026
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: lkocman <510119+lkocman@users.noreply.github.com>
Agent-Logs-Url: https://github.com/openSUSE/opensuse-migration-tool/sessions/41d3b5de-f126-4143-8e99-9673ba2737b1 Co-authored-by: lkocman <510119+lkocman@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Fix ShellCheck CI false positives for
Fix ShellCheck CI false positives and harden ShellCheck workflow permissions
May 17, 2026
/etc/os-release variables
Copilot stopped work on behalf of
lkocman due to an error
May 17, 2026 14:14
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses ShellCheck CI false positives around sourcing /etc/os-release and variables populated from it, while tightening workflow permissions.
Changes:
- Suppresses ShellCheck’s external source warning for
/etc/os-release. - Initializes
NAMEandVERSIONafter sourcing to satisfy static analysis. - Adds read-only repository contents permission to the ShellCheck workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
opensuse-migration-tool |
Updates ShellCheck handling for /etc/os-release-provided variables. |
.github/workflows/shellcheck.yml |
Adds minimal contents: read permission for the workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
shellcheckGitHub Actions job failed on the main script due to static-analysis false positives around sourcing/etc/os-release. This change makes that sourcing explicit for linting and ensures referenced OS metadata variables are always defined in-script.Lint-scope fix for external source
/etc/os-releasesource line to handle CI lint context where the file is not part of analyzed inputs.Defensive initialization of sourced vars
NAMEandVERSIONwith default-empty fallbacks immediately after sourcing, removingSC2153undefined-variable findings without changing runtime behavior.Workflow security hardening
permissions:contents: readTouched files
opensuse-migration-tool.github/workflows/shellcheck.yml