Skip to content

Implement OWASP issue campaign workflow with dry-run issue text artifacts#157

Draft
hdamker wants to merge 6 commits intocamaraproject:mainfrom
hdamker:feature/owasp-issue-campaign
Draft

Implement OWASP issue campaign workflow with dry-run issue text artifacts#157
hdamker wants to merge 6 commits intocamaraproject:mainfrom
hdamker:feature/owasp-issue-campaign

Conversation

@hdamker
Copy link
Copy Markdown
Contributor

@hdamker hdamker commented Mar 2, 2026

Note: Replaces #154 which was accidentally closed when commits were pushed directly to main due to incorrect local branch tracking. The direct push has been reverted.

What type of PR is this?

  • enhancement/feature

What this PR does / why we need it:

This PR implements the OWASP issue campaign requested in #144.

It adds a new issue-based workflow to scan CAMARA API repositories and prepare/create one issue per affected repository with actionable schema-fix guidance.

Main additions:

  • New workflow: campaign-owasp-linting.yml
  • New action: actions/read-owasp-compliance
    • runs Spectral OWASP checks
    • normalizes findings to template-ready output
    • supports rule_profile (api4-target, full-camara-owasp)
  • New campaign docs/template under campaigns/owasp-linting/

Campaign behavior:

  • dry_run (plan) and apply modes
  • topic-based target selection (sandbox-api-repository, incubating-api-repository)
  • repository_filter accepts single name or comma-separated list
  • deduplicated issue creation via existing campaign-finalize-issue-per-repo
  • explicit BULK_CAMPAIGN_TOKEN validation + documented FGPAT requirements

Dry-run output requirement from #144 is implemented:

  • per-repo planned issue text artifact (repo.txt, status.txt, issue-body.md) for affected repos
  • aggregated plan-issue-texts.md for reviewer/operator inspection

Which issue(s) this PR fixes:

Fixes #144

Special notes for reviewers:

Please specifically review the generated issue text quality and completeness:

  • template: campaigns/owasp-linting/templates/issue-body.mustache
  • action output shaping: actions/read-owasp-compliance/src/index.js

Validation evidence (fork run):

Changelog input

Add OWASP linting issue campaign workflow with per-repo dry-run issue text artifacts and FGPAT requirements

Additional documentation

  • campaigns/owasp-linting/README.md

hdamker added 3 commits March 2, 2026 20:56
…ext artifacts

Add a new issue-based campaign workflow (campaign-owasp-linting.yml) that scans CAMARA sandbox/incubating API repositories for OWASP findings and opens one issue per affected repository using the existing campaign-finalize-issue-per-repo action.

Implement new local action actions/read-owasp-compliance that runs Spectral in JSON mode against code/API_definitions, normalizes findings, supports rule profiles (api4-target and full-camara-owasp), and exposes structured outputs for templating and reporting:

- json, summary, has_findings

- finding_count, error_count, warning_count, files_checked

Add campaign content under campaigns/owasp-linting:

- README with run instructions, inputs, and output artifacts

- issue-body.mustache with summary, detailed findings, rule guidance, and Commonalities references

Implement required dry-run behavior to preserve full issue text per repository:

- For each repo with findings in plan mode, upload dedicated artifact containing repo.txt, status.txt, issue-body.md

- In aggregate job, merge per-repo issue text artifacts into plan-issue-texts.md

- Upload plan-issue-texts.md as separate artifact and mention it in job summary

This makes plan mode decision-ready by exposing exact issue bodies before apply, while keeping idempotent dedup behavior in apply mode.
…ions

Add explicit precheck in campaign-owasp-linting run job to fail fast when BULK_CAMPAIGN_TOKEN is missing, and use the token for target repository checkout.

Update campaign README with required FGPAT setup:

- secret name: BULK_CAMPAIGN_TOKEN

- repository access across target API repositories

- Issues read/write and Contents read permissions

Also set github-script repository discovery step to prefer BULK_CAMPAIGN_TOKEN with fallback to GITHUB_TOKEN.
Allow repository_filter to accept a comma-separated list of repository names in addition to a single name. Parse the input into a normalized set and include repos when any listed name matches.

Also update workflow input description and campaign README with multi-repository example usage.
@hdamker hdamker marked this pull request as draft March 20, 2026 08:49
@hdamker
Copy link
Copy Markdown
Contributor Author

hdamker commented Mar 20, 2026

Converted to draft — see parking rationale on #144.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement OWASP linting check campaign workflow

1 participant