Repository navigation
feat(github): configurable build-deploy roles and separate MSBuild output paths - #48
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0387c9c4bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tput paths Part of the v11 migration (released as v11.1). Fix #45: build-deploy exported its publish folder as an `outputPath` environment variable (job env and $GITHUB_ENV). MSBuild reads environment variables as properties, so every project in a multi-project solution built into that folder. The variable is now TEMPLATE_OUTPUT_PATH, matching pr-build (#44); the publish location is unchanged. A self-test guard fails if any workflow exports an MSBuild output-path property again. Implement #46: build-deploy no longer hard-codes the management-account role and region. Callers pass roleArn (development, non-tag runs) and productionRoleArn (production, tag runs), plus awsRegion (default us-east-1). A composite action validates them and selects the role before the build and before any credentials are requested; tag runs require productionRoleArn and never fall back to roleArn. configure-aws-credentials is pinned to a commit and masks the account ID. No IAM, trust, or permission changes. Callers moving build-deploy from v10 with runCdk: true pass roleArn and, for tag runs, productionRoleArn; to keep the v10 behavior, pass arn:aws:iam::403542860824:role/github-deploy-role for both and awsRegion: us-east-1. Callers pinned to v10.x are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ncipollina
force-pushed
the
feat/build-deploy-role-config-and-output-path
branch
from
October 14, 2026 02:36
0387c9c to
9897863
Compare
The role-ARN check limited everything after `role/` to 64 characters, which rejected valid roles with a path (IAM allows a path of up to 512 characters plus a 64-character name) and path punctuation. Validate the partition, account, path, and name separately in resolve-aws-deploy-role and cdk-preview, and add self-test cases for path roles and the limits. Addresses Codex review feedback on #48. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#45: MSBuild
OutputPathcollisionbuild-deploy.yamlexposed its publish folder as anoutputPathenvironment variable, both as a job-levelenvand through two$GITHUB_ENVwrites. MSBuild reads environment variables as properties case-insensitively, so every project built into that folder.TEMPLATE_OUTPUT_PATH, matchingpr-build.yaml(fix(github): stop pr-build redirecting MSBuild output and fix cdk-preview jq #44). Updated: the job env, both$GITHUB_ENVwrites, and all 4${{ env.… }}references (Blazor publish, Lambda Native AOT action input, Lambda ZIP path, SPA copy).outputPathinput and the composite action'soutputPathinput. The publish location is the same as before..github/scripts/check-msbuild-env.py, run by the new self-test, fails if any workflow or action exports an MSBuild output-path property (OutputPath,OutDir,BaseOutputPath,IntermediateOutputPath,PublishDir, …) throughenv:or$GITHUB_ENV.#46: configurable deployment roles
The hard-coded
arn:aws:iam::403542860824:role/github-deploy-roleandus-east-1are removed.cdk-preview.yaml:roleArn: development, non-tag runsproductionRoleArn: production, tag runsawsRegion: defaultus-east-1.github/actions/resolve-aws-deploy-role:runCdk: true, so validation happens before anything is built and before credentials are requested.refs/tags/*(which deploys<stackName>-prod) →productionRoleArn; all other runs →roleArn.productionRoleArnfails. There is no fallback toroleArn. A consumer that wants one role passes the same ARN to both inputs.build-deployon push tomain(development) or byworkflow_dispatch. Production runs are dispatches on a tag (CloudTrail showsref:refs/tags/*contexts), so explicit configuration is practical.configure-aws-credentialsis pinned toe1253824…(v6.3.0) as incdk-preview.yaml, and now masks the account ID.id-token: write,contents: writefor the existing release tagging), triggers, and every build, test, publish, deploy and tag step. No IAM roles, trust policies, accounts or permissions are changed.roleArncredentials (never on tag runs), which is correct today but more permission than tests need. Separating them is tracked in [Feature]: Run build-deploy integration tests with a narrower role than the deployment role #47 and kept out of this PR.Validation
build-deploy.yaml$/…reference for the new action, the same known false positive as the existing Lambda action. The rest are pre-existing shellcheck notes also present onmainself-test-build-deploy.ymlmain/v10.8build-deployjob env + 2$GITHUB_ENVwrites) / fail (5: alsopr-build, fixed by #44)outputPath=<tmp>/publishin the environment (old behavior)publish/net10.0/, neither in its ownbin(#45 reproduced)TEMPLATE_OUTPUT_PATH=<tmp>/publishsrc/SelfTest.Library/bin/Release/net10.0/…andsrc/SelfTest.Second/bin/Release/net10.0/…; nothing inpublish/The 8 role-resolution cases:
roleArn, with or withoutproductionRoleArnproductionRoleArnproductionRoleArnfails (no fallback)roleArnfailsroleArn(shell metacharacters) failsproductionRoleArnthat is an IAM user ARN failsCodex review (P2, role paths): fixed in
37b6430. ARNs are validated by part:aws,aws-cnoraws-us-govThe same fix applies to
cdk-preview.yaml'sroleArn, which had the same limit. There are 5 new self-test cases (13 role-resolution cases in total, all passing on GitHub), and the same 13 cases were also run locally againstcdk-preview's copy of the check, which agreed on every ARN.Runner-level validation (throwaway branch, deleted; run 38502935434). This revision's
build-deploy.yamlran on a real runner through two paths that stop before any build, deploy or tag:$/resolution: the logs show$/resolving toLayeredCraft/devops-templates/.github/actions/resolve-aws-deploy-role@<this revision>.runCdk: truewithoutroleArn: failed at step 2 withrunCdk is true, but roleArn is not set…. All 27 later steps were skipped, including the CDK deploy and the tag step.arn:aws:iam::000000000000:role/…): the job loggedDeploying development with the role from roleArn.and the selected role reachedconfigure-aws-credentials, which AWS refused. The CDK deploy, integration tests and tag step were skipped.No AWS deployment was made and no resource was touched to validate this.
build-deploy.yamlitself is not run in CI because it deploys and pushes tags.Compatibility and release
Part of the v11 migration. Recommended release: v11.1 (Release Drafter:
type: feat→ minor).build-deploy.yamlunchanged from v10, so v11.1 completes the v11 migration forbuild-deployrather than starting another major line.build-deployfrom v10 withrunCdk: true: callers passroleArn, andproductionRoleArnfor tag runs. Callers withrunCdk: falseare unaffected.pr-build.yamlis unchanged.cdk-preview.yamlnow also accepts IAM role paths (see the Codex fix below).v7.2→fc844c8,v10.7→1401b8f,v10.8→0ab844d, andv11.0→5b2db86are unchanged, none contain this PR, and theirbuild-deploy.yamlstill has the old role. Nobody's reference is updated here:ncipollina/infrastructure,trivia-platform×4,trivia-manager,lightsaber-skill,cosmere-tracker.Migration for existing consumers
To keep exactly the v10 behavior:
Separate, narrowly trusted roles are preferred: development trust on
ref:refs/heads/main, production on tags or a protected environment, exactrepository_id, nopull_request, and nojob_workflow_refpinning. The README positions this in the v11 migration and documents the inputs, role selection, missing-configuration errors and migration.Remaining risks and follow-ups
$/composite action reference: actionlint doesn't recognize it, but it has now been exercised on a real runner (above). A cross-repository consumer run happens at first adoption of v11.1, the same mechanism the existing Lambda action already uses across repositories since v10.7.github-deploy-roletrust (repo:ncipollina/*,AdministratorAccess) is unchanged and tracked separately where that role is defined.TMD_*/TMP_*/OPENAI_*secrets inbuild-deploy.yamlare untouched (out of scope).Closes #45
Closes #46
🤖 Generated with Claude Code