Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

This PR adds a new GitHub Actions workflow that can be manually triggered to automatically format code, run linting, build the project, execute the comprehensive agent-finish validation sequence, and commit any resulting changes.

What's Added

New Workflow: .github/workflows/format-and-commit.yml

The workflow includes:

  • Manual Trigger: Uses workflow_dispatch to allow on-demand execution
  • Environment Setup: Configures both Go and Node.js environments with proper caching
  • Comprehensive Validation: Runs the complete development pipeline:
    • make fmt - Code formatting
    • make lint - Linting and style checks
    • make build - Binary compilation
    • make agent-finish - Complete validation sequence (includes deps-dev, fmt, lint, js, build, test-all, recompile)
  • Smart Commits: Only commits changes if formatting/linting actually modified files
  • Proper Git Configuration: Uses github-actions bot identity for automated commits

Use Cases

This workflow is particularly useful for:

  • Batch formatting and cleanup of code changes
  • Ensuring all validation steps pass before manual review
  • Automated maintenance tasks that require committing generated files
  • Quick project-wide formatting when multiple contributors have different IDE settings

Implementation Details

The workflow follows the existing repository patterns:

  • Uses the same action versions as ci.yml (actions/checkout@v5, actions/setup-go@v5, etc.)
  • Leverages the existing Makefile targets for consistency
  • Includes proper error handling and shellcheck-compliant scripts
  • Validates successfully with actionlint

The change detection logic ensures no empty commits are created, and the commit message provides clear context about what automated changes were applied.

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
    • Triggering command: /tmp/go-build1594418971/b278/cli.test -test.testlogfile=/tmp/go-build1594418971/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.

- Created .github/workflows/format-and-commit.yml
- Triggers on workflow_dispatch for manual execution
- Runs fmt, lint, build, agent-finish steps
- Commits changes if any are detected
- Includes proper git configuration and shellcheck fixes

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review September 4, 2025 12:10
@pelikhan pelikhan changed the title [WIP] create a github action workflow - that triggers on workflow_dispatch - formats, lint, build, agent_finish - commit changes lint format workflow Sep 4, 2025
@pelikhan pelikhan merged commit 66f6ebb into main Sep 4, 2025
8 checks passed
@pelikhan pelikhan deleted the copilot/fix-b718586b-27ff-430e-9584-89a34897d9ed branch September 4, 2025 12:12
Copilot AI restored the copilot/fix-b718586b-27ff-430e-9584-89a34897d9ed branch September 4, 2025 12:12
Copilot AI changed the title lint format workflow Add GitHub Actions workflow for automated formatting, linting, building, and committing Sep 4, 2025
Copilot AI requested a review from pelikhan September 4, 2025 12:13
@pelikhan pelikhan deleted the copilot/fix-b718586b-27ff-430e-9584-89a34897d9ed branch September 17, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants