Skip to content

feat(techdocs): allow AWS account ID via vars (drop caller secrets block)#95

Merged
dkastl merged 1 commit into
mainfrom
feat/94-techdocs-account-id-via-vars
Jul 6, 2026
Merged

feat(techdocs): allow AWS account ID via vars (drop caller secrets block)#95
dkastl merged 1 commit into
mainfrom
feat/94-techdocs-account-id-via-vars

Conversation

@dkastl

@dkastl dkastl commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Reusable workflows don't auto-inherit secrets — only the vars context. The AWS account ID was the one setting that forced every caller of reusable-backstage-techdocs.yml to keep a secrets: block (or secrets: inherit, which the org Security suite flags via zizmor secrets-inherit).

Since an account ID is a non-sensitive identifier — and the org now has a TECHDOCS_AWS_ACCOUNT_ID variable — this adds a vars fallback to the account-ID cascade:

AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID || secrets.TECHDOCS_AWS_ACCOUNT_ID || vars.AWS_ACCOUNT_ID || vars.TECHDOCS_AWS_ACCOUNT_ID }}

Back-compat: secrets are tried first, so existing secrets: / secrets: inherit callers are unaffected. Callers relying on the org variable can now drop the secrets: block entirely:

jobs:
  publish:
    permissions:            # irreducible — OIDC requires the caller to grant id-token: write
      contents: read
      id-token: write
    uses: geolonia/.github/.github/workflows/reusable-backstage-techdocs.yml@<sha>  # vX

Also updates the secret-input descriptions to point at the vars alternative.

Closes #94

Test plan

  • YAML valid
  • Cascade tries secrets before vars (no behavior change for existing callers)
  • After merge: a consumer with the org variable set and no secrets: block publishes TechDocs successfully (verify on the first repo we simplify)

Follow-up

Simplify individual consumers to drop their secrets: block (e.g. geonicdb-infra-cdk's publish-techdocs.yml), once this lands.

Summary by CodeRabbit

  • Documentation

    • Clarified the recommended way to provide AWS account IDs, with guidance to use repository or organization variables when available.
  • Bug Fixes

    • Improved the default AWS account selection order so it now falls back more reliably when building the OIDC role ARN.

Reusable workflows don't auto-inherit secrets (only vars), so the AWS
account ID was the one setting forcing every caller to keep a secrets:
block (or secrets: inherit, which zizmor flags). An account ID is a
non-sensitive identifier, so read it from the vars context too:

  ...|| vars.AWS_ACCOUNT_ID || vars.TECHDOCS_AWS_ACCOUNT_ID

Back-compat: secrets are still tried first, so existing callers are
unaffected. Callers that set the org/repo variable can now drop the
secrets: block entirely (down to permissions: + uses:).

Closes #94
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1f4b898a-49df-40aa-ac53-0f09c3a18223

📥 Commits

Reviewing files that changed from the base of the PR and between 0d06c91 and 4df9c21.

📒 Files selected for processing (1)
  • .github/workflows/reusable-backstage-techdocs.yml

Walkthrough

The reusable Backstage TechDocs workflow was updated to add fallback resolution for the AWS account ID: it now checks vars.AWS_ACCOUNT_ID and vars.TECHDOCS_AWS_ACCOUNT_ID after the existing secrets, and secret input descriptions were revised to note this preference.

Changes

AWS Account ID Fallback

Layer / File(s) Summary
Secret input docs and env precedence
.github/workflows/reusable-backstage-techdocs.yml
Secret input descriptions for AWS_ACCOUNT_ID/TECHDOCS_AWS_ACCOUNT_ID now note preference for vars.*, and the AWS_ACCOUNT_ID env variable falls back through secrets.* then vars.* when computing the default OIDC role ARN.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related issues: #94 — allow AWS account ID via vars (drop caller secrets block)

Suggested reviewers: geolonia workflow maintainers

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: allowing AWS account ID to come from vars in the TechDocs reusable workflow.
Description check ✅ Passed The description includes a clear summary, test notes, and the related issue reference, matching the template well enough.
Linked Issues check ✅ Passed The workflow now falls back to vars for AWS account ID and updates descriptions, while keeping secrets first for compatibility.
Out of Scope Changes check ✅ Passed The changes stay focused on the reusable workflow and its descriptions; no unrelated scope is apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/94-techdocs-account-id-via-vars

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

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🛡️ Security suite

Check Result
✅ Supply chain · bumblebee No exposure matches
✅ Secrets · betterleaks No secrets in diff
✅ Action pinning · pinact All actions pinned
✅ Actions audit · zizmor No findings

Note

All security checks passed.

Updated for 4df9c21 · workflow run

@dkastl
dkastl merged commit 6793909 into main Jul 6, 2026
6 checks passed
@dkastl
dkastl deleted the feat/94-techdocs-account-id-via-vars branch July 6, 2026 05:33
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.

reusable-backstage-techdocs: allow AWS account ID via vars (drop caller secrets block)

1 participant