You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolve githubactions:S7635 ("Only pass required secrets to this workflow") in the two caller stubs by replacing secrets: inherit with an explicit mapping of only the secrets each reusable actually declares — behavior-preserving.
Findings analysis
Verified the two central reusables' workflow_call.secrets declarations:
Note: the pr-review caller header only documented GH_PAT_WORKFLOWS; the reusable requires two secrets. secrets: inherit silently forwarded both, so the explicit mapping must pass both to preserve behavior.
Implementation Checklist
.github/workflows/dependabot-automerge.yml — replace secrets: inherit with explicit APP_ID + APP_PRIVATE_KEY mapping; update header contract (remove the "MUST NOT change secrets: inherit" clause, keep the permissions/uses guidance).
.github/workflows/pr-review-mention.yml — replace secrets: inherit with explicit GH_PAT_WORKFLOWS + DON_PETRY_BOT_GH_PAT mapping; update header contract and the "Requires:" line to list both secrets.
bash .dev-lead/scripts/dev-lead-lint.sh + YAML syntax validation via python yaml.safe_load.
Note on central source of truth
These stubs are declared verbatim copies of central petry-projects/.github standards. This edit resolves the audit locally but drifts from the central stub; a follow-up should propagate the explicit-secrets change to the central source of truth so a future fanout does not revert it.
(No JS unit suite applies — this is a behavior-preserving CI/config change, Phase 2 TDD exception.)
Files Changed
.github/workflows/dependabot-automerge.yml: replaced secrets: inherit with an explicit mapping of the two secrets the reusable declares (APP_ID, APP_PRIVATE_KEY); reworded the "MUST NOT change" contract accordingly.
.github/workflows/pr-review-mention.yml: replaced secrets: inherit with an explicit mapping of the two secrets the reusable declares (GH_PAT_WORKFLOWS, DON_PETRY_BOT_GH_PAT); updated the "Requires:" documentation, which previously listed only one of the two required secrets.
Notes
Behavior preserved: each explicit mapping passes exactly the secrets the corresponding reusable declares as required: true, which is the same set secrets: inherit was forwarding. The pr-review reusable requires two secrets; the caller header had only documented one, so enumerating solely GH_PAT_WORKFLOWS would have broken it — both are now passed and documented.
Unrelated finding untouched: the # NOSONAR(githubactions:S7637) on the uses: line is a separate rule and was left as-is.
Central source-of-truth drift (follow-up): these files are verbatim caller stubs mirrored from petry-projects/.github standards. This fix is local; the same explicit-secrets change should be propagated to the central stub templates so a future fanout does not re-introduce secrets: inherit. Recommend opening a follow-up against the central repo.
Activity
don-petry commentedon Jul 7, 2026
Dev-Lead Implementation Plan
Issue: #348 — SonarCloud: S7635 secrets-inherit caller stubs
Scope
Resolve
githubactions:S7635("Only pass required secrets to this workflow") in the two caller stubs by replacingsecrets: inheritwith an explicit mapping of only the secrets each reusable actually declares — behavior-preserving.Findings analysis
Verified the two central reusables'
workflow_call.secretsdeclarations:dependabot-automerge-reusable.ymlrequires:APP_ID,APP_PRIVATE_KEY(bothrequired: true)pr-review-mention-reusable.ymlrequires:GH_PAT_WORKFLOWS,DON_PETRY_BOT_GH_PAT(bothrequired: true)Note: the pr-review caller header only documented
GH_PAT_WORKFLOWS; the reusable requires two secrets.secrets: inheritsilently forwarded both, so the explicit mapping must pass both to preserve behavior.Implementation Checklist
.github/workflows/dependabot-automerge.yml— replacesecrets: inheritwith explicitAPP_ID+APP_PRIVATE_KEYmapping; update header contract (remove the "MUST NOT changesecrets: inherit" clause, keep the permissions/uses guidance)..github/workflows/pr-review-mention.yml— replacesecrets: inheritwith explicitGH_PAT_WORKFLOWS+DON_PETRY_BOT_GH_PATmapping; update header contract and the "Requires:" line to list both secrets.Tests to Write
.dev-lead/scripts/dev-lead-lint.sh.Test Command
bash .dev-lead/scripts/dev-lead-lint.sh+ YAML syntax validation via pythonyaml.safe_load.Note on central source of truth
These stubs are declared verbatim copies of central
petry-projects/.githubstandards. This edit resolves the audit locally but drifts from the central stub; a follow-up should propagate the explicit-secrets change to the central source of truth so a future fanout does not revert it.don-petry commentedon Jul 7, 2026
Dev-Lead: Implementation Complete
Plan Execution
.github/workflows/dependabot-automerge.yml—secrets: inherit→ explicitAPP_ID+APP_PRIVATE_KEY; header contract updated..github/workflows/pr-review-mention.yml—secrets: inherit→ explicitGH_PAT_WORKFLOWS+DON_PETRY_BOT_GH_PAT; header contract + "Requires:" list updated.workflow_call.secretsdeclaration..dev-lead/scripts/dev-lead-lint.sh(green).Test Results
(No JS unit suite applies — this is a behavior-preserving CI/config change, Phase 2 TDD exception.)
Files Changed
.github/workflows/dependabot-automerge.yml: replacedsecrets: inheritwith an explicit mapping of the two secrets the reusable declares (APP_ID,APP_PRIVATE_KEY); reworded the "MUST NOT change" contract accordingly..github/workflows/pr-review-mention.yml: replacedsecrets: inheritwith an explicit mapping of the two secrets the reusable declares (GH_PAT_WORKFLOWS,DON_PETRY_BOT_GH_PAT); updated the "Requires:" documentation, which previously listed only one of the two required secrets.Notes
required: true, which is the same setsecrets: inheritwas forwarding. The pr-review reusable requires two secrets; the caller header had only documented one, so enumerating solelyGH_PAT_WORKFLOWSwould have broken it — both are now passed and documented.# NOSONAR(githubactions:S7637)on theuses:line is a separate rule and was left as-is.petry-projects/.githubstandards. This fix is local; the same explicit-secrets change should be propagated to the central stub templates so a future fanout does not re-introducesecrets: inherit. Recommend opening a follow-up against the central repo.don-petry commentedon Jul 14, 2026
SonarCloud Audit (2026-07-14): still open — 2 finding(s), worst severity
MAJOR.