Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/initiative-planner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
# Mirrors add-to-project.yml / pr-review-mention.yml; local refs also avoid the
# SHA-pin security finding a remote tag ref raises on the hosting repo.
uses: ./.github/workflows/initiative-planner-reusable.yml
secrets: inherit
secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 45 additions & 2 deletions standards/ci-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,42 @@ exemption is present. It files `sonar-s7637-exemption-missing` (warning) when a
SonarCloud-gated repo has neither, and `sonar-s7637-exemption-too-broad` (error)
when the legacy exemption uses a blanket workflow-path `resourceKey`.

#### SonarCloud Exemption: First-Party `secrets: inherit` S7635

SonarCloud's rule **`githubactions:S7635`** ("only pass required secrets to this
workflow") fires on the **`secrets: inherit`** line of a first-party caller stub.
Caller stubs pass `secrets: inherit` **by design** so the central reusable
receives every secret it needs (e.g. `GH_PAT_WORKFLOWS` + `CLAUDE_CODE_OAUTH_TOKEN` + more) without each caller enumerating — and re-enumerating on every reusable
change. The reusable is **first-party and fully trusted**, the same trust boundary
that exempts the channel ref from S7637 above.

**Standard (canonical — inline NOSONAR on the `secrets:` line):** every
first-party caller stub that uses `secrets: inherit` MUST carry an inline
`# NOSONAR(githubactions:S7635)` marker on that line, e.g.:

```yaml
jobs:
idea-triage:
uses: petry-projects/.github/.github/workflows/idea-triage-reusable.yml@idea-triage/stable # NOSONAR(githubactions:S7637) first-party channel ref
secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
```

Like the S7637 marker, SonarCloud suppresses S7635 on exactly that line, so the
exemption travels **with the stub file** — verbatim adopters inherit it with
**zero** per-repo `sonar-project.properties` entries. The grandfathered existing
deployments pass because they are not "new code"; the rule only bites a stub the
first time it is **added** to a SonarCloud-gated repo. (The legacy per-file
`sonar.issue.ignore.multicriteria` mechanism with `ruleKey=githubactions:S7635`
also works and is accepted during transition, but the inline marker is canonical.)

Caller-stub templates that use `secrets: inherit` and therefore carry the S7635
marker: `initiative-planner.yml`, `idea-triage.yml`, `idea-enhancer.yml`.
**Pending:** `dev-lead.yml`, `auto-rebase.yml`, `dependabot-automerge.yml`, and
`pr-review-mention.yml` also use `secrets: inherit` but do not yet carry the
marker; because they are already deployed fleet-wide (so re-syncing them fans out
broadly) the marker is being added to them under a separate rollout — until then a
**new** adoption of one of those four needs the legacy per-file S7635 exemption.

### 4. Secret Scanning (`ci.yml` — gitleaks job)

Secret detection via the gitleaks action. This job **must be added to the CI pipeline**
Expand Down Expand Up @@ -1131,8 +1167,15 @@ Where a planner-created epic lands depends on the repo:
#### Adopting in a new repo

1. Copy [`standards/workflows/initiative-planner.yml`](workflows/initiative-planner.yml)
to `.github/workflows/initiative-planner.yml` (and, optionally,
`idea-triage.yml`) in the target repo.
and [`standards/workflows/initiative-driver.yml`](workflows/initiative-driver.yml)
to `.github/workflows/` (and, optionally,
[`standards/workflows/idea-triage.yml`](workflows/idea-triage.yml) and
[`standards/workflows/idea-enhancer.yml`](workflows/idea-enhancer.yml)) in the
target repo. Copy **verbatim** — the templates carry the inline
`# NOSONAR(githubactions:S7637)` and `# NOSONAR(githubactions:S7635)` markers,
so a SonarCloud-gated repo needs **no** `sonar-project.properties` edits (see
[SonarCloud Exemption: First-Party Reusable-Ref S7637](#sonarcloud-exemption-first-party-reusable-ref-s7637)
and [First-Party `secrets: inherit` S7635](#sonarcloud-exemption-first-party-secrets-inherit-s7635)).
2. Ensure Discussions is enabled with an "Ideas" category, and **create the gate
labels** the pipeline relies on. The driver's `initiative:auto` gate **cannot be
armed if its label is missing** (the driver pilot hit exactly this — see #888),
Expand Down
2 changes: 1 addition & 1 deletion standards/workflows/idea-enhancer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ permissions: {}
jobs:
idea-enhancer:
uses: petry-projects/.github/.github/workflows/idea-enhancer-reusable.yml@idea-enhancer/stable # NOSONAR(githubactions:S7637) first-party channel ref
secrets: inherit
secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
2 changes: 1 addition & 1 deletion standards/workflows/idea-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ permissions: {}
jobs:
idea-triage:
uses: petry-projects/.github/.github/workflows/idea-triage-reusable.yml@idea-triage/stable # NOSONAR(githubactions:S7637) first-party channel ref
secrets: inherit
secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
2 changes: 1 addition & 1 deletion standards/workflows/initiative-planner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ permissions: {}
jobs:
initiative-planner:
uses: petry-projects/.github/.github/workflows/initiative-planner-reusable.yml@initiative-planner/stable # NOSONAR(githubactions:S7637) first-party channel ref
secrets: inherit
secrets: inherit # NOSONAR(githubactions:S7635) first-party trusted reusable
Loading