You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-06-03 16:35:37 +02:00
Add CI check for docs on feature PRs (#6315)
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
DOCS_CHANGED=$(echo "$CI_PIPELINE_FILES" | jq -r '.[]' | grep -c '^docs/docs/' || true)
|
||||
if [ "$DOCS_CHANGED" -gt 0 ]; then
|
||||
echo "✅ OK: docs/docs/ has changes"
|
||||
exit 0
|
||||
fi
|
||||
NON_CLI=$(echo "$CI_PIPELINE_FILES" | jq -r '.[]' | grep -v '^cli/' | grep -v '^cmd/cli/' | grep -v '^docs/' || true)
|
||||
if [ -z "$NON_CLI" ]; then
|
||||
echo "✅ OK: CLI-only feature, docs are auto-generated"
|
||||
exit 0
|
||||
fi
|
||||
echo "🚨 ERROR: PR has 'feature' label but no changes in docs/docs/"
|
||||
echo "Please add documentation for the new feature."
|
||||
exit 1
|
||||
@@ -25,6 +25,15 @@ steps:
|
||||
settings:
|
||||
version: 3.6.2
|
||||
|
||||
- name: check-feature-docs
|
||||
image: docker.io/alpine:3.23
|
||||
depends_on: []
|
||||
commands:
|
||||
- apk add --no-cache -q jq && ./.woodpecker/check-feature-docs.sh
|
||||
when:
|
||||
- event: pull_request
|
||||
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "feature"'
|
||||
|
||||
- name: agentscan
|
||||
image: docker.io/woodpeckerci/plugin-agentscan:latest
|
||||
pull: true
|
||||
|
||||
Reference in New Issue
Block a user