Centralize git credential configuration in workflow compiler#590
Centralize git credential configuration in workflow compiler#590
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…orkflow step - Remove git config calls from create_pull_request.cjs and push_to_branch.cjs - Update corresponding tests to reflect removed git configuration - Centralized git configuration is handled by generateGitConfiguration() in compiler - All 270 JavaScript tests and full Go test suite pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…configuration Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ate_pull_request job - Added git configuration step to push_to_branch job in output_push_to_branch.go - Created generateGitConfigurationSteps() helper function for centralized git configuration - Replaced inline git configuration in buildCreateOutputPullRequestJob with centralized function call - Both jobs now use the same standardized git credential setup approach - All tests pass and workflows recompile successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Fixes #583 by implementing centralized git credential configuration through the workflow compiler instead of duplicating git setup across individual JavaScript components.
Problem
The git credential setup was inconsistent and duplicated across different parts of the workflow compiler:
action@github.com/GitHub Actioncreate_pull_request.cjs,push_to_branch.cjs) each had their own git configuration codegit_patch.go) had inline git configuration embedded within its executionThis led to unpredictable behavior, code duplication, and extra processing overhead when agents attempted git operations.
Solution
Implemented a fully centralized git credential configuration approach:
github-actions[bot]@users.noreply.github.com(GitHub's standard bot identity)${{ github.workflow }}(uses the actual workflow name for better traceability)Key Changes
Added centralized git configuration in the main job workflow:
generateGitConfiguration()function incompiler.goRemoved duplicate git configurations from JavaScript files:
pkg/workflow/js/create_pull_request.cjspkg/workflow/js/push_to_branch.cjsRemoved inline git configuration from Go workflow generation:
pkg/workflow/git_patch.go: Removed inline git configuration from patch generation stepAdded git configuration to create_pull_request job:
create_pull_requestjob now includes its own git configuration stepAdded git configuration to push_to_branch job:
push_to_branchjob now includes its own git configuration stepCentralized git configuration helper functions:
generateGitConfigurationSteps()helper function for jobs that work with []string stepsDeduplicated git configuration functions:
generateGitConfiguration()to usegenerateGitConfigurationSteps()as single source of truthBenefits
Testing
The fix ensures that git operations "just work" from the start of any workflow execution through proper configuration in each job that needs git operations, eliminating all duplication and the need for agents to discover and configure git credentials during their processing.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.