Skip to content

feat(cdk): add 4 additional github:* resource tags#93

Merged
mayakost merged 1 commit into
mainfrom
feature/github-additional-tags
May 14, 2026
Merged

feat(cdk): add 4 additional github:* resource tags#93
mayakost merged 1 commit into
mainfrom
feature/github-additional-tags

Conversation

@mayakost
Copy link
Copy Markdown
Contributor

Summary

New Tags

Tag key CI variable Rationale
github:base-ref ${{ github.base_ref }} / event.merge_group.base_ref Distinguishes deployment target branch from source. Critical for merge_group and pull_request where github:ref is the source, not the target.
github:pr-number ${{ github.event.pull_request.number }} / extracted from merge group ref Direct trace-back from deployed resource → PR. Simplifies cleanup queries (aws resourcegroupstaggingapi get-resources --tag-filters Key=github:pr-number).
github:run-attempt ${{ github.run_attempt }} Distinguishes retries (same run-id, different attempt). Without this, redeployed resources from a retry look identical to the first attempt.
github:workflow ${{ github.workflow }} If multiple workflows can deploy (e.g., deploy.yml vs hotfix.yml), identifies which produced this state.

Test plan

  • 3 existing tests in cdk/test/stacks/github-tags.test.ts updated for all 13 tags
    • All 13 tags default to none when no context provided
    • Tags reflect context values when provided (including new tags)
    • Empty string values resolve to none
  • TypeScript compiles cleanly

Add base-ref, pr-number, run-attempt, and workflow tags to improve
deployment traceability and simplify resource cleanup queries.
@mayakost mayakost requested a review from a team as a code owner May 14, 2026 19:42
@mayakost mayakost enabled auto-merge May 14, 2026 19:44
Copy link
Copy Markdown
Contributor

@scottschreckengaust scottschreckengaust left a comment

Choose a reason for hiding this comment

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

LGTM

@mayakost mayakost added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 5d9748f May 14, 2026
6 checks passed
@mayakost mayakost deleted the feature/github-additional-tags branch May 14, 2026 20:22
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