Skip to content

[Repo Assist] ci: fail-fast Go format check and add copilot-setup-steps timeout #465

@github-actions

Description

@github-actions

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Two small CI workflow optimizations implementing the suggestions from issue #463 (ci-coach). These follow fail-fast principles and add a safety guard with no impact on passing builds.

Changes

1. Go Format Check: Fail Fast Before Build & Test

Moved the gofmt format check step to run immediately after actions/setup-go in build-go, before go mod download, go build, and go test.

Before:

setup-go → go mod download → go build → go test → gofmt check
```

**After:**
```
setup-go → gofmt check ← fails here immediately if unformatted
         → go mod download → go build → go test

Impact: ~1–2 minutes saved per run when formatting is wrong. The format check only needs the Go toolchain (already installed by setup-go), so failing early avoids downloading all dependencies and compiling.

2. copilot-setup-steps: Add timeout-minutes: 10

Added timeout-minutes: 10 to the copilot-setup-steps job. Without this, a hung dependency install or network issue could consume a runner for the default 6-hour GitHub Actions limit. All four language runtimes install in well under 5 minutes.

Closes

Implements the suggestion from issue #463.

Test Status

✅ No test changes; workflow YAML is syntactically valid (diff reviewed).
These changes only affect step ordering and add a safety timeout — no logic changes to the build process itself.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@b466f28f0f65b68d6f2b10b15b44f51d787b93be

Note

This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 22820573997 -n agent-artifacts -D /tmp/agent-artifacts-22820573997

# Create a new branch
git checkout -b repo-assist/ci-go-format-timeout-e523d3234e4b8242

# Apply the patch (--3way handles cross-repo patches where files may already exist)
git am --3way /tmp/agent-artifacts-22820573997/aw-repo-assist-ci-go-format-timeout.patch

# Push the branch to origin
git push origin repo-assist/ci-go-format-timeout-e523d3234e4b8242

# Create the pull request
gh pr create --title '[Repo Assist] ci: fail-fast Go format check and add copilot-setup-steps timeout' --base main --head repo-assist/ci-go-format-timeout-e523d3234e4b8242 --repo askpt/openfeature-aspire-sample
Show patch preview (66 of 66 lines)
From e9c4e8e39805edf39ffdfa940a252abaa7e0183a Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sun, 8 Mar 2026 11:59:23 +0000
Subject: [PATCH] ci: fail-fast Go format check and add copilot-setup-steps
 timeout

Move gofmt check before go mod download/build/test in build-go job so
formatting failures are caught immediately (~1-2 min savings on failure).

Add timeout-minutes: 10 to copilot-setup-steps job to prevent runaway
runner consumption on network issues or hung dependency installs.

Implements suggestion from #463.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 .github/workflows/ci.yml                  | 12 ++++++------
 .github/workflows/copilot-setup-steps.yml |  1 +
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d8acb01..52c3da2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -105,12 +105,6 @@ jobs:
         with:
           go-version-file: src/Garage.FeatureFlags/go.mod
           cache-dependency-path: src/Garage.FeatureFlags/go.sum
-      - name: Download dependencies
-        run: go mod download
-      - name: Build
-        run: go build -v ./...
-      - name: Test
-        run: go test -v ./...
       - name: Format check
         run: |
           if [ -n "$(gofmt -l .)" ]; then
@@ -118,6 +112,12 @@ jobs:
             gofmt -d .
             exit 1
           fi
+      - name: Download dependencies
+        run: go mod download
+      - name: Build
+        run: go build -v ./...
+      - name: Test
+        run: go test -v ./...
 
   build-python:
     needs: changes
diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml
index ed76c5f..ac30117 100644
--- a/.github/workflows/copilot-setup-steps.yml
+++ b/.github/workflows/copilot-setup-steps.yml
@@ -10,6 +10,7 @@ name: Copilot Setup Steps
 jobs:
   copilot-setup-steps:
     
... (truncated)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions