Conversation
- Consolidate safeUintToInt to delegate to safeUint64ToInt - Delete tombstone file safe_outputs_generation.go - Split safe_outputs_jobs.go into jobs/steps/env files - Rename safe_output_parser.go -> safe_outputs_parser.go - Rename safe_output_validation_config.go -> safe_outputs_validation_config.go - Update logger namespaces to match renamed files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 16, 2026 19:07
View session
7 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors pkg/workflow safe-outputs code to reduce duplication, remove a tombstone file, and split a large multi-concern module into focused files while normalizing logger namespaces and helper usage.
Changes:
- Deduplicates
safeUintToIntby delegating tosafeUint64ToIntand removes the unusedmathimport. - Splits step-building and env-var assembly logic out of
safe_outputs_jobs.gointo new focused modules. - Normalizes safe-outputs logger namespaces and removes a tombstone file.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_validation_config.go | Updates logger namespace to the normalized safe_outputs_ prefix. |
| pkg/workflow/safe_outputs_steps.go | New module containing safe-output step builder helpers previously in safe_outputs_jobs.go. |
| pkg/workflow/safe_outputs_parser.go | Updates logger namespace to the normalized safe_outputs_ prefix. |
| pkg/workflow/safe_outputs_jobs.go | Slims down to job config + job builder; removes step/env helper implementations. |
| pkg/workflow/safe_outputs_generation.go | Deletes tombstone file that only contained a relocation comment. |
| pkg/workflow/safe_outputs_env.go | New module containing safe-output env-var assembly helpers previously in safe_outputs_jobs.go. |
| pkg/workflow/frontmatter_extraction_metadata.go | Deduplicates safeUintToInt implementation and removes unused import. |
Comments suppressed due to low confidence (2)
pkg/workflow/safe_outputs_parser.go:5
safeOutputParserLognow emits the plural namespaceworkflow:safe_outputs_parser, but the variable name is still singular (safeOutput...). This is inconsistent with the rest of the safe-outputs loggers (e.g.,safeOutputsJobsLog,safeOutputsStepsLog) and makes grepping harder. Rename the logger variable tosafeOutputsParserLog(and update its uses in this file) to match the normalized naming.
pkg/workflow/safe_outputs_validation_config.go:9safeOutputValidationLognow uses the plural namespaceworkflow:safe_outputs_validation_config, but the variable name remains singular. To keep naming consistent with the rest of the safe-outputs code (e.g.,safeOutputsJobsLog,safeOutputsEnvLog), rename this variable tosafeOutputsValidationLogand update references in this file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+75
to
+79
| // Get safe-outputs level token | ||
| var safeOutputsToken string | ||
| if data.SafeOutputs != nil { | ||
| safeOutputsToken = data.SafeOutputs.GitHubToken | ||
| } |
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.
Four findings from a semantic analysis of
pkg/workflow— one functional duplicate, one tombstone file, one multi-concern file exceeding the 300-line guideline, and two naming inconsistencies.Changes
Deduplicate conversion helpers —
safeUintToIntinfrontmatter_extraction_metadata.gonow delegates tosafeUint64ToIntinmap_helpers.goviareturn safeUint64ToInt(uint64(u)), removing identical overflow logic. Unusedmathimport removed.Delete tombstone —
safe_outputs_generation.gowas 7 lines of only a comment cataloguing where code moved; deleted.Split
safe_outputs_jobs.go(694 lines, 3 logger namespaces) into three focused files:safe_outputs_jobs.go—SafeOutputJobConfig+buildSafeOutputJobsafe_outputs_steps.go—GitHubScriptStepConfig,buildCustomActionStep,buildGitHubScriptStep,buildGitHubScriptStepWithoutDownload,buildAgentOutputDownloadStepssafe_outputs_env.go— all env-var assembly functionsNormalize file naming — rename singular-prefix outliers to match the
safe_outputs_convention used by all other files in the package:safe_output_parser.go→safe_outputs_parser.gosafe_output_validation_config.go→safe_outputs_validation_config.goworkflow:safe_outputs_parser,workflow:safe_outputs_validation_config)