grafana/scripts/drone/pipelines/shellcheck.star
Kevin Minehart 7a2edd35d5
CI: Support more version formats in publishing (#94575)
* cleanup dead code
* add tests and rewrite publish grafanacom steps to reuse
* add pkg/build tests; don't upload CDN assets on grafana releases
2024-10-15 09:27:13 -05:00

50 lines
978 B
Plaintext

"""
This module returns a Drone step and pipeline for linting with shellcheck.
"""
load(
"scripts/drone/utils/images.star",
"images",
)
load(
"scripts/drone/utils/utils.star",
"pipeline",
)
trigger = {
"event": [
"pull_request",
],
"paths": {
"exclude": [
"*.md",
"docs/**",
"latest.json",
],
"include": ["scripts/**/*.sh"],
},
}
def shellcheck_step():
return {
"name": "shellcheck",
"image": images["ubuntu"],
"commands": [
"apt-get update -yq && apt-get install shellcheck",
"shellcheck -e SC1071 -e SC2162 scripts/**/*.sh",
],
}
def shellcheck_pipeline():
environment = {"EDITION": "oss"}
steps = [
shellcheck_step(),
]
return pipeline(
name = "pr-shellcheck",
trigger = trigger,
services = [],
steps = steps,
environment = environment,
)