Skip to content

Commit 512e3cd

Browse files
committed
Fix shellcheck warning and update README
- Add shellcheck disable for intentional word splitting in java-ci.yml - Update README workflows table with missing workflows - Add Reusable Workflows section documenting java/python/kyverno-ci - Add Releases section explaining tagging process - Add Kyverno Policies section with usage example
1 parent 6cbbbf2 commit 512e3cd

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

.github/workflows/java-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ jobs:
214214
# -DnvdApiDelay=2500 - 2.5s delay between NVD API calls to avoid 403 rate limiting
215215
# -DnvdMaxRetryCount=10 - retry failed API calls
216216
# -Ddependencycheck.failOnError=false - don't fail build on vulnerabilities found
217+
# shellcheck disable=SC2086 # ANALYSIS_GOALS intentionally unquoted for word splitting
217218
echo "Running analysis tools: $MVN_CMD -B -ntp -DskipTests -DnvdApiDelay=2500 -DnvdMaxRetryCount=10 -Ddependencycheck.failOnError=false $ANALYSIS_GOALS"
219+
# shellcheck disable=SC2086 # ANALYSIS_GOALS intentionally unquoted for word splitting
218220
$MVN_CMD -B -ntp -DskipTests -DnvdApiDelay=2500 -DnvdMaxRetryCount=10 -Ddependencycheck.failOnError=false $ANALYSIS_GOALS || echo "Some analysis tools completed with errors"
219221
fi
220222
else

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,21 @@ flowchart LR
2929
| Workflow | Purpose | Trigger |
3030
|----------|---------|---------|
3131
| `hub-run-all.yml` | Central mode: clone each repo, run all tools, upload reports | push to main, schedule, manual |
32-
| `hub-orchestrator.yml` | Dispatch mode: trigger reusable workflows (`hub-*.yml`) in target repos | manual |
32+
| `hub-orchestrator.yml` | Dispatch mode: trigger reusable workflows in target repos | manual |
3333
| `smoke-test.yml` | Sanity check fast profiles against fixture repos | manual |
3434
| `config-validate.yml` | Validate `config/repos/*.yaml` against schema | push/PR |
35-
| `java-ci.yml` / `python-ci.yml` | Reusable workflows for dispatch mode | called by orchestrator |
35+
| `hub-self-check.yml` | Validate hub workflows and configs | push to main |
36+
| `release.yml` | Create GitHub releases and manage version tags | tag push `v*.*.*` |
37+
38+
### Reusable Workflows
39+
40+
External repos call these via `uses:` in their caller workflows:
41+
42+
| Workflow | Purpose |
43+
|----------|---------|
44+
| `java-ci.yml` | Full Java CI: build, test, coverage, mutation, security scans |
45+
| `python-ci.yml` | Full Python CI: pytest, coverage, mutation, linting, security scans |
46+
| `kyverno-ci.yml` | Kubernetes policy validation (optional, for K8s deployments) |
3647

3748
## Running the Hub (central mode)
3849
```bash
@@ -87,6 +98,48 @@ thresholds:
8798
- Java: runs PITest across all modules containing the plugin; aggregates all `mutations.xml` files.
8899
- Python: runs mutmut with coverage-driven selection; reports killed/survived counts.
89100

101+
## Releases
102+
103+
The hub uses semantic versioning. To create a release:
104+
105+
```bash
106+
# Tag a new version
107+
git tag v1.0.0
108+
git push origin v1.0.0
109+
110+
# This triggers release.yml which:
111+
# 1. Validates reusable workflows with actionlint
112+
# 2. Runs tests
113+
# 3. Creates a GitHub Release
114+
# 4. Updates floating major tag (v1 -> latest v1.x.x)
115+
```
116+
117+
External repos should pin to the major version (e.g., `@v1`) for automatic minor/patch updates, or pin to exact version (e.g., `@v1.0.0`) for stability.
118+
119+
## Kyverno Policies (Optional)
120+
121+
For Kubernetes deployments, the hub includes Kyverno policies for runtime admission control:
122+
123+
| Policy | Purpose |
124+
|--------|---------|
125+
| `block-pull-request-target` | Block dangerous GHA trigger |
126+
| `require-referrers` | Require SBOM/provenance annotations |
127+
| `secretless` | Block static secrets, enforce OIDC |
128+
| `verify-images` | Verify Cosign keyless signatures |
129+
130+
Use the reusable `kyverno-ci.yml` workflow to validate your policies:
131+
132+
```yaml
133+
jobs:
134+
kyverno:
135+
uses: jguida941/ci-cd-hub/.github/workflows/kyverno-ci.yml@v1
136+
with:
137+
policies_dir: 'policies/kyverno'
138+
run_tests: true
139+
```
140+
141+
See `docs/adr/0012-kyverno-policies.md` for details.
142+
90143
## Documentation
91144
Documentation is under `docs/` with the structure:
92145
```

0 commit comments

Comments
 (0)