ci: lint the scanner and validate the CI configs - #47
Open
joeymussalli wants to merge 1 commit into
Open
Conversation
This repo has had no continuous integration of any kind. The entire
product is one bash script, scan/trustabl-scan.sh, plus the two config
files that invoke it: the CodeBuild buildspec and the CodeCatalyst
workflow. Nothing checks any of them. A stray typo in the script, or a
YAML edit that drops a key one of the integrations reads, ships
unnoticed and only surfaces in a customer's pipeline.
This adds a single GitHub Actions job that validates everything that can
be validated without running a scan. It downloads nothing, needs no
credentials, and holds only `contents: read`.
- `bash -n` on scan/trustabl-scan.sh, catching syntax errors.
- shellcheck on the same file, gated at `error` severity.
- shellcheck again at `warning` and above, reported but not enforced.
- YAML parse of codepipeline/buildspec.yml and
codecatalyst/workflows/trustabl.yaml, plus assertions on the keys
the integrations actually consume: the buildspec's
phases.build.commands and artifacts.files, the workflow's
Actions.Trustabl_Scan.Configuration.Steps and Outputs.Artifacts, and
that both still invoke scan/trustabl-scan.sh by that path. A file
that parses but has lost artifacts.files is still broken, so parsing
alone would not be worth much.
Every command was run locally against this tree before committing:
bash -n exits 0; shellcheck 0.10.0 reports zero findings at `error` and
exactly two at `warning`, both SC2034 for the unused SCAN_START and
SCAN_END; the structural validator passes all seventeen assertions, and
fails as intended when artifacts.files or the script path is removed
from a scratch copy. The workflow file itself was parsed with PyYAML and
its step structure inspected.
The severity gate is set at `error` deliberately, so this workflow is
green on main the day it lands rather than arriving red with a backlog
attached; the warning-level findings are still printed on every run via
a continue-on-error step, so they stay visible. A sibling branch,
chore/remove-dead-code, removes those two unused variables and takes the
file to zero at `warning` level. Once it lands, the gate can be tightened
to --severity=warning; nothing here depends on that happening.
joeymussalli
force-pushed
the
ci/lint-and-validate
branch
from
August 24, 2026 20:05
4fc286e to
086cc7e
Compare
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.
This repo has had no continuous integration of any kind. The entire product is one bash script, scan/trustabl-scan.sh, plus the two config files that invoke it: the CodeBuild buildspec and the CodeCatalyst workflow. Nothing checks any of them. A stray typo in the script, or a YAML edit that drops a key one of the integrations reads, ships unnoticed and only surfaces in a customer's pipeline.
This adds a single GitHub Actions job that validates everything that can be validated without running a scan. It downloads nothing, needs no credentials, and holds only
contents: read.bash -non scan/trustabl-scan.sh, catching syntax errors.errorseverity.warningand above, reported but not enforced.Every command was run locally against this tree before committing: bash -n exits 0; shellcheck 0.10.0 reports zero findings at
errorand exactly two atwarning, both SC2034 for the unused SCAN_START and SCAN_END; the structural validator passes all seventeen assertions, and fails as intended when artifacts.files or the script path is removed from a scratch copy. The workflow file itself was parsed with PyYAML and its step structure inspected.The severity gate is set at
errordeliberately, so this workflow is green on main the day it lands rather than arriving red with a backlog attached; the warning-level findings are still printed on every run via a continue-on-error step, so they stay visible. A sibling branch, chore/remove-dead-code, removes those two unused variables and takes the file to zero atwarninglevel. Once it lands, the gate can be tightened to --severity=warning; nothing here depends on that happening.