Open
fix(gha): register resolved secrets with runner masking#477
Conversation
7 tasks
Copilot
AI
changed the title
[WIP] Fix GitHub Action to register resolved secrets with runner masking
fix(gha): register resolved secrets with runner masking
Jul 31, 2026
macalbert
marked this pull request as ready for review
July 31, 2026 21:46
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
There was a problem hiding this comment.
Pull request overview
Registers resolved GitHub Action secrets with GitHub runner masking by introducing an ISecretMasker port and wiring a GitHub-specific adapter in the GHA container while keeping CLI behavior unchanged (no-op masker).
Changes:
- Added
ISecretMaskerdomain port plus GitHub Actions and no-op implementations. - Updated
PullSecretsToEnvCommandHandlerto register each non-empty resolved value with the masker before persisting. - Updated DI wiring and tests for CLI/GHA startup resolution, plus GitHub Action docs about masking limits and safer
env-filepaths.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/envilder/core/infrastructure/github/GitHubActionsSecretMasker.test.ts | Adds unit coverage for escaped ::add-mask:: emission. |
| tests/envilder/core/application/pullSecretsToEnv/PullSecretsToEnvCommandHandler.test.ts | Verifies masking happens before save and skips empty/missing values. |
| tests/envilder/apps/gha/Startup.test.ts | Asserts GHA binds ISecretMasker to GitHubActionsSecretMasker. |
| tests/envilder/apps/cli/Startup.test.ts | Asserts CLI binds ISecretMasker to NoOpSecretMasker. |
| src/envilder/core/types.ts | Registers ISecretMasker symbol for DI. |
| src/envilder/core/infrastructure/github/NoOpSecretMasker.ts | Introduces no-op masker for non-GHA runtimes. |
| src/envilder/core/infrastructure/github/GitHubActionsSecretMasker.ts | Implements escaped ::add-mask:: emission for runner masking. |
| src/envilder/core/domain/ports/ISecretMasker.ts | Adds new domain port interface. |
| src/envilder/core/application/pullSecretsToEnv/PullSecretsToEnvCommandHandler.ts | Calls secretMasker.mask(value) before persisting resolved secrets. |
| src/envilder/apps/shared/ContainerConfiguration.ts | Binds default ISecretMasker to no-op when not explicitly provided. |
| src/envilder/apps/gha/Startup.ts | Overrides ISecretMasker binding to GitHub Actions implementation. |
| github-action/README.md | Documents masking behavior/limitations and recommends ${{ runner.temp }} env file path when possible. |
Comment on lines
+1
to
+3
| import type { ISecretMasker } from '../../domain/ports/ISecretMasker.js'; | ||
|
|
||
| export class GitHubActionsSecretMasker implements ISecretMasker { |
Comment on lines
+1
to
+3
| import type { ISecretMasker } from '../../domain/ports/ISecretMasker.js'; | ||
|
|
||
| export class NoOpSecretMasker implements ISecretMasker { |
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.
Pull Request
What does this PR do?
Registers every non-empty secret resolved by the GitHub Action with runner masking before the value is written to the environment file.
Runner masking
::add-mask::adapter behind an injectedISecretMaskerport.Runtime wiring
Documentation
${{ runner.temp }}/envilder.envwhen consumers support an explicit path.Related issues
Type of change
Checklist
Notes for reviewer
Tests cover raw runner-mask registration before persistence, exclusion of missing/empty values, command escaping, and CLI/GHA DI bindings.