Skip to content

feat(cdk): add github:* resource tagging strategy#85

Merged
krokoko merged 1 commit into
mainfrom
feature/github-resource-tagging
May 13, 2026
Merged

feat(cdk): add github:* resource tagging strategy#85
krokoko merged 1 commit into
mainfrom
feature/github-resource-tagging

Conversation

@scottschreckengaust
Copy link
Copy Markdown
Contributor

Summary

  • Applies 9 github:* tags to all stack resources via Tags.of(stack).add() in main.ts
  • Tags are injected through CDK context (-c github:sha=..., etc.) and default to sentinel none
  • Ensures consistent tag schema across all stacks for cleanup harvesting and CI/CD provenance

Closes #84

Tags

Tag key CI variable gh / git CLI Default
github:sha $GITHUB_SHA gh api /repos/{owner}/{repo}/commits/{ref} --jq .sha / git rev-parse HEAD none
github:ref $GITHUB_REF_NAME gh api /repos/{owner}/{repo}/git/ref/heads/{branch} --jq .ref / git branch --show-current none
github:ref-type $GITHUB_REF_TYPE gh api /repos/{owner}/{repo}/git/ref/heads/{branch}branch or /tags/{tag}tag / git cat-file -t $(git rev-parse HEAD) none
github:actor $GITHUB_ACTOR gh api /user --jq .login / git config user.name none
github:head-ref $GITHUB_HEAD_REF gh pr view --json headRefName --jq .headRefName / none (only in PR context) none
github:run-id $GITHUB_RUN_ID gh run list --limit 1 --json databaseId --jq '.[0].databaseId' / N/A (CI only) none
github:event $GITHUB_EVENT_NAME gh run view {run-id} --json event --jq .event / N/A (CI only) none
github:repository $GITHUB_REPOSITORY gh repo view --json nameWithOwner --jq .nameWithOwner / git remote get-url origin none
github:clean true (CI always clean) N/A / [ -z "$(git status --porcelain)" ] && echo true || echo false none

Test plan

  • 3 new tests in cdk/test/stacks/github-tags.test.ts
    • All 9 tags default to none when no context provided
    • Tags reflect context values when provided
    • Empty string values resolve to none
  • All 38 existing agent.test.ts tests pass unchanged
  • TypeScript compiles cleanly

🤖 Generated with Claude Code

Apply 9 github:* tags to all stack resources via CDK context values.
Tags default to 'none' when not provided, ensuring consistent tag schema
across all stacks for cleanup harvesting and CI/CD provenance tracking.

Closes #84

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@krokoko krokoko added this pull request to the merge queue May 13, 2026
Merged via the queue into main with commit a59ca35 May 13, 2026
7 checks passed
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.

Add github:* resource tagging strategy to CDK stacks

2 participants