Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
reviewed
Sep 12, 2025
pelikhan
reviewed
Sep 12, 2025
Copilot
AI
changed the title
[WIP] Update format lint workflow to create a pull request instead of trying to push to the branch directly. Run on every push to main.
Update format lint workflow to create pull request instead of direct push
Sep 12, 2025
Copilot stopped work on behalf of
pelikhan due to an error
September 12, 2025 14:28
Removed the step for handling no changes in the format-and-commit workflow.
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.
This PR updates the
format-and-commit.ymlworkflow to create pull requests instead of pushing changes directly to the main branch, addressing the requirement to run on every push to main while maintaining proper code review practices.Changes Made
Trigger Configuration
workflow_dispatch)push: branches: [main])Pull Request Creation Logic
The workflow now creates pull requests when formatting changes are detected:
Security Improvements
Permission Updates
Added
pull-requests: writepermission while maintaining existingcontents: writefor branch operations.Why This Change?
The previous workflow pushed changes directly to branches, which bypasses code review processes. The new approach:
Testing
actionlintThe workflow will activate on the next push to main that results in formatting changes, creating a pull request with the auto-formatted code for review and merge.
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:
api.contoso.com/tmp/go-build2748979727/b278/cli.test -test.testlogfile=/tmp/go-build2748979727/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build1700973130/b278/cli.test -test.testlogfile=/tmp/go-build1700973130/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build1003136296/b278/cli.test -test.testlogfile=/tmp/go-build1003136296/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.