Skip to content

fix(compliance): disable false positive reusable-workflow-path-duplicate-github check#164

Closed
don-petry wants to merge 3 commits into
mainfrom
feat/gitleaks-license-standard
Closed

fix(compliance): disable false positive reusable-workflow-path-duplicate-github check#164
don-petry wants to merge 3 commits into
mainfrom
feat/gitleaks-license-standard

Conversation

@don-petry
Copy link
Copy Markdown
Contributor

@don-petry don-petry commented Apr 28, 2026

Summary

Disables a false-positive compliance audit check that incorrectly flags the correct GitHub reusable workflow reference pattern.

Issue: The compliance audit was flagging petry-projects/.github/.github/workflows/... as incorrect
Root cause: The check didn't account for GitHub's reusable workflow syntax where the first segment is the repo name and the second is the path within that repo
Solution: Disable the check and document why the double .github/ pattern is correct per org standards

Affected Repositories

This fix prevents false-positive compliance issues across 6 repos:

Changes

  • Disabled check_reusable_workflow_paths() in scripts/compliance-audit.sh
  • Added documentation explaining the correct pattern per GitHub's reusable workflow syntax
  • Reduces compliance audit noise going forward

Reference

GitHub Reusable Workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows

Correct pattern: uses: petry-projects/.github/.github/workflows/workflow-name.yml@v1

Summary by CodeRabbit

  • Documentation

    • Added CI standards for secret scanning using gitleaks, including setup requirements, environment variable configuration, and troubleshooting guidance for both organization and personal repositories.
  • Chores

    • Disabled reusable workflow path syntax audit check.

don-petry and others added 3 commits April 28, 2026 05:15
Add gitleaks secret scanning as §4 of the required CI workflows and document:
- Why organization repositories require a license (free tier available)
- How to obtain and configure the GITLEAKS_LICENSE secret
- Standard workflow configuration with environment variable setup
- Common failure modes and troubleshooting

Update organization-level secrets table to include GITLEAKS_LICENSE.
Renumber subsequent sections (5-8 become 6-9) for correct ordering.
…can job spec

- Add blank line before code fence in numbered list (MD031 fix)
- Reference canonical secret-scan job definition in push-protection.md
- Highlight GITLEAKS_LICENSE requirement for organization repositories
- Keep license setup and troubleshooting documentation

The canonical job specification in push-protection.md#layer-3 is the single source of truth. This change ensures we document the organization-specific GITLEAKS_LICENSE requirement without duplicating the job YAML.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ath-duplicate-github

The check incorrectly flagged petry-projects/.github/.github/workflows/ as
invalid, but this is the CORRECT pattern per org standards:
- First .github = repository name
- Second .github/workflows = directory path within that repository

GitHub reusable workflows require this double-segment syntax. This check was
producing false positives across all repos. Disable it to reduce noise in
compliance audits and prevent automated issue creation for valid patterns.

Affected repos: TalkTerm, broodly, google-app-scripts, ContentTwin, markets, bmad-bgreat-suite

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 28, 2026 13:45
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

Disabled a reusable workflow path audit check in the compliance script and added required gitleaks secret scanning documentation to CI standards, including GITLEAKS_LICENSE environment variable requirements for organization repositories.

Changes

Cohort / File(s) Summary
Compliance Audit
scripts/compliance-audit.sh
Disabled the check_reusable_workflow_paths function by replacing audit logic with documentation and early return, effectively deactivating checks for duplicate .github/ patterns in workflow uses: references.
CI Standards Documentation
standards/ci-standards.md
Added required gitleaks secret scanning job section with GITLEAKS_LICENSE environment variable requirements for organization repos, license setup guidance, and CI failure remediation. Updated subsequent section numbering and extended organization secrets table.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • PR #98: Introduces a workflow that uses reusable workflow path references that the disabled audit was validating.
  • PR #163: Documents gitleaks license requirements that align with the added CI standards section.
  • PR #12: Added the original compliance-audit script that is being modified in this change.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: disabling a false positive compliance check for reusable workflow paths.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gitleaks-license-standard

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
standards/ci-standards.md (1)

490-499: 🧹 Nitpick | 🔵 Trivial

Section numbering is inconsistent after renumbering.

AgentShield is now ### 8, but Auto-Rebase is also still ### 8. This should be renumbered to keep headings and cross-references unambiguous.

Suggested doc-numbering cleanup
-### 8. Auto-Rebase (`auto-rebase.yml`)
+### 9. Auto-Rebase (`auto-rebase.yml`)
@@
-### 9. Feature Ideation (`feature-ideation.yml`) — BMAD Method repos
+### 10. Feature Ideation (`feature-ideation.yml`) — BMAD Method repos
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@standards/ci-standards.md` around lines 490 - 499, The section headings are
misnumbered: "AgentShield" is labeled "### 8" and "Auto-Rebase" is also "### 8";
update the markdown headings so numbering progresses correctly (e.g., change
"Auto-Rebase" to "### 9"), and scan nearby headings to ensure the sequence after
"AgentShield" (and any subsequent headings) is consistent; also update any
internal cross-references or mentions of `agent-shield.yml` and
`auto-rebase.yml` (and the table of contents if present) so they reflect the
corrected numbering.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@standards/ci-standards.md`:
- Around line 243-245: Update the canonical job specification in
push-protection.md (the "Layer 3: CI Secret Scanning" snippet) to include the
required GITLEAKS_LICENSE environment variable or add an explicit note in
standards/ci-standards.md that the canonical block must be extended with
GITLEAKS_LICENSE for org repos; specifically edit the job snippet referenced by
"Layer 3: CI Secret Scanning" to add the GITLEAKS_LICENSE env entry (or an
adjacent comment) so teams copying the canonical template won't miss the
required license variable.

---

Outside diff comments:
In `@standards/ci-standards.md`:
- Around line 490-499: The section headings are misnumbered: "AgentShield" is
labeled "### 8" and "Auto-Rebase" is also "### 8"; update the markdown headings
so numbering progresses correctly (e.g., change "Auto-Rebase" to "### 9"), and
scan nearby headings to ensure the sequence after "AgentShield" (and any
subsequent headings) is consistent; also update any internal cross-references or
mentions of `agent-shield.yml` and `auto-rebase.yml` (and the table of contents
if present) so they reflect the corrected numbering.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d29af8c4-b297-449a-9155-96cf30184f15

📥 Commits

Reviewing files that changed from the base of the PR and between 5b345af and 2dfbc88.

📒 Files selected for processing (2)
  • scripts/compliance-audit.sh
  • standards/ci-standards.md

Comment thread standards/ci-standards.md
Comment on lines +243 to +245
**Standard configuration:** See the canonical job specification in
[`push-protection.md` — Layer 3: CI Secret Scanning](push-protection.md#layer-3--ci-secret-scanning-secondary-defense).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Cross-doc config drift: canonical secret-scan reference omits the now-required org license env.

This section points readers to push-protection.md as the canonical job config, but that canonical snippet currently lacks GITLEAKS_LICENSE. Teams copying only the canonical block can still hit the exact failure you describe. Please sync the canonical template (or explicitly state here that the canonical block must be extended for org repos).

Also applies to: 246-255

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@standards/ci-standards.md` around lines 243 - 245, Update the canonical job
specification in push-protection.md (the "Layer 3: CI Secret Scanning" snippet)
to include the required GITLEAKS_LICENSE environment variable or add an explicit
note in standards/ci-standards.md that the canonical block must be extended with
GITLEAKS_LICENSE for org repos; specifically edit the job snippet referenced by
"Layer 3: CI Secret Scanning" to add the GITLEAKS_LICENSE env entry (or an
adjacent comment) so teams copying the canonical template won't miss the
required license variable.

@don-petry don-petry enabled auto-merge (squash) April 28, 2026 13:49
@don-petry
Copy link
Copy Markdown
Contributor Author

Closing in favor of #165 which is based on latest main

@don-petry don-petry closed this Apr 28, 2026
auto-merge was automatically disabled April 28, 2026 13:50

Pull request was closed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce compliance-audit noise by disabling a false-positive check around GitHub reusable workflow uses: path syntax (the valid petry-projects/.github/.github/workflows/... pattern).

Changes:

  • Disables check_reusable_workflow_paths() in scripts/compliance-audit.sh and documents why the double .github/ segment is valid.
  • Adds a new “Secret Scanning (gitleaks)” section and updates the org secret list in standards/ci-standards.md.
  • Renumbers several “Required Workflows” subsections in standards/ci-standards.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/compliance-audit.sh Disables the reusable-workflow path check and adds explanatory comments.
standards/ci-standards.md Adds/updates documentation (secret scanning + renumbered required-workflow sections + secret list entry).
Comments suppressed due to low confidence (1)

standards/ci-standards.md:500

  • Section numbering is now inconsistent: AgentShield is labeled ### 8, but the next section Auto-Rebase is also labeled ### 8. Please renumber Auto-Rebase (and any subsequent sections) to keep unique, sequential section numbers.
### 8. AgentShield (`agent-shield.yml`)

Agent configuration security validation. Checks that CLAUDE.md and
AGENTS.md exist and follow standards, scans for secrets in agent config
files, validates SKILL.md frontmatter, and detects permission bypasses.
See [`workflows/agent-shield.yml`](workflows/agent-shield.yml) and the
[Agent Configuration Standards](agent-standards.md) for full details.

### 8. Auto-Rebase (`auto-rebase.yml`)

Keeps open non-Dependabot PRs up-to-date with the base branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Reference: https://docs.github.com/en/actions/using-workflows/reusing-workflows
# Example: uses: petry-projects/.github/.github/workflows/claude-code-reusable.yml@v1
check_reusable_workflow_paths() {
local repo="$1"
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_reusable_workflow_paths now declares local repo="$1" but never uses it. This triggers ShellCheck SC2034 (unused variable) and will fail the ShellCheck CI job. Remove the unused variable assignment (or explicitly disable SC2034 for that line) so the script passes linting.

Suggested change
local repo="$1"

Copilot uses AI. Check for mistakes.
Comment thread standards/ci-standards.md
Comment on lines +246 to +277
**Organization repos only — GITLEAKS_LICENSE requirement:**

When adding the `secret-scan` job to an organization repository's `ci.yml`, you **must**
pass the `GITLEAKS_LICENSE` secret to the gitleaks action:

```yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
```

Without this environment variable, gitleaks will fail with "missing gitleaks license"
when scanning in an organization context.

**Required secrets:** `GITLEAKS_LICENSE` (org-level, organization repositories only)

**License requirement:** Gitleaks is free for open-source, but organization scans
require a valid license. Obtain a free license at [gitleaks.io](https://gitleaks.io).

**License setup:**

1. Create or log into your account at [gitleaks.io](https://gitleaks.io)
2. Generate a free license key for your organization
3. Add the license as the org-level secret `GITLEAKS_LICENSE`:

```bash
gh secret set GITLEAKS_LICENSE --org petry-projects --body "<license-key>"
```

**For personal/user repos:** The `GITLEAKS_LICENSE` environment variable is optional.
If omitted, gitleaks runs in open-source mode (free, no license needed).

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new section asserts that gitleaks requires GITLEAKS_LICENSE for organization repos and that runs will fail without it, but the canonical CI job in standards/push-protection.md does not set or mention GITLEAKS_LICENSE at all (it only passes GITHUB_TOKEN). Please reconcile these standards (either update push-protection.md + the canonical job spec accordingly, or remove/correct the license requirement here) to avoid misleading adopters.

Suggested change
**Organization repos only — GITLEAKS_LICENSE requirement:**
When adding the `secret-scan` job to an organization repository's `ci.yml`, you **must**
pass the `GITLEAKS_LICENSE` secret to the gitleaks action:
```yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
```
Without this environment variable, gitleaks will fail with "missing gitleaks license"
when scanning in an organization context.
**Required secrets:** `GITLEAKS_LICENSE` (org-level, organization repositories only)
**License requirement:** Gitleaks is free for open-source, but organization scans
require a valid license. Obtain a free license at [gitleaks.io](https://gitleaks.io).
**License setup:**
1. Create or log into your account at [gitleaks.io](https://gitleaks.io)
2. Generate a free license key for your organization
3. Add the license as the org-level secret `GITLEAKS_LICENSE`:
```bash
gh secret set GITLEAKS_LICENSE --org petry-projects --body "<license-key>"
```
**For personal/user repos:** The `GITLEAKS_LICENSE` environment variable is optional.
If omitted, gitleaks runs in open-source mode (free, no license needed).
**Configuration source of truth:**
The `secret-scan` job must match the canonical configuration in
[`push-protection.md`](push-protection.md#layer-3--ci-secret-scanning-secondary-defense).
Do not add extra required secrets or environment variables unless they are also
specified there.
At present, this standard does **not** impose a separate organization-only
requirement to pass `GITLEAKS_LICENSE`. If gitleaks licensing or authentication
requirements change in the future, update the canonical job specification in
`push-protection.md` first, then mirror that guidance here.
**Required secrets:** Use only the secrets required by the canonical job
definition in `push-protection.md`.
**Note:** If you encounter a repository or vendor-specific need for additional
gitleaks configuration, treat that as a standards update task rather than local
repo drift.

Copilot uses AI. Check for mistakes.
Comment thread standards/ci-standards.md
and the [Dependabot Policy](dependabot-policy.md).

### 7. AgentShield (`agent-shield.yml`)
### 8. AgentShield (`agent-shield.yml`)
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renumbering the required-workflow headings changes the generated Markdown anchors (e.g. Claude Code was previously referenced as #4-claude-code-claudeyml in multiple workflow headers and scripts). With Claude now labeled §5 and subsequent sections shifted, those in-repo links become stale (for example .github/workflows/claude.yml and scripts/compliance-audit.sh still reference the old anchors). Either keep the existing section numbers/anchors stable or update all inbound references in the repo to the new anchors.

Suggested change
### 8. AgentShield (`agent-shield.yml`)
### 8A. AgentShield (`agent-shield.yml`)

Copilot uses AI. Check for mistakes.
Comment thread standards/ci-standards.md
Comment on lines +233 to +260
### 4. Secret Scanning (`ci.yml` — gitleaks job)

Secret detection via the gitleaks action. This job **must be added to the CI pipeline**
for all organization repositories. The job scans commit history for hardcoded secrets,
API keys, and other sensitive data.

**Why a separate job?** Gitleaks requires a license key when scanning organization
repositories (free for open-source). The job is part of the main `ci.yml` pipeline
but documented separately to clarify the licensing requirement.

**Standard configuration:** See the canonical job specification in
[`push-protection.md` — Layer 3: CI Secret Scanning](push-protection.md#layer-3--ci-secret-scanning-secondary-defense).

**Organization repos only — GITLEAKS_LICENSE requirement:**

When adding the `secret-scan` job to an organization repository's `ci.yml`, you **must**
pass the `GITLEAKS_LICENSE` secret to the gitleaks action:

```yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
```

Without this environment variable, gitleaks will fail with "missing gitleaks license"
when scanning in an organization context.

**Required secrets:** `GITLEAKS_LICENSE` (org-level, organization repositories only)
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description/title focus on disabling the false-positive reusable-workflow-path check and documenting the .github/.github reusable-workflow pattern, but this hunk introduces a new numbered “Secret Scanning (gitleaks)” section and adds GITLEAKS_LICENSE to the org secrets list. If this is intentional, please update the PR description to reflect the additional scope; otherwise, consider splitting the secret-scanning documentation into a separate PR.

Copilot uses AI. Check for mistakes.
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.

2 participants