Skip to content

Add copilot-setup-steps workflow for automated agent development#217

Merged
HermanPlay merged 5 commits intomasterfrom
copilot/prepare-workflow-for-automation
Dec 7, 2025
Merged

Add copilot-setup-steps workflow for automated agent development#217
HermanPlay merged 5 commits intomasterfrom
copilot/prepare-workflow-for-automation

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

Adds GitHub Actions workflow to prepare development environment for Copilot agents before they start work.

Changes

  • .github/workflows/copilot-setup-steps.yml: New workflow that:
    • Sets up Go 1.24.2 using go-version-file: go.mod for automatic version detection
    • Installs dependencies via go mod tidy
    • Installs golangci-lint v2 (matches project's .golangci.yaml v2 config)
    • Installs swag CLI from mini-maxit/swag fork (consistent with docs.yaml workflow)
    • Implements caching for Go modules and installed tools to speed up subsequent runs

Workflow Triggers

  • Manual via workflow_dispatch
  • Auto-runs on changes to the workflow file itself

Configuration

jobs:
  copilot-setup-steps:  # Name required by Copilot
    runs-on: ubuntu-latest
    permissions:
      contents: read  # Minimal permissions; Copilot gets its own token

Uses actions/checkout@v4 and actions/setup-go@v5 with go-version-file: go.mod for consistency with existing workflows. Caching is enabled for both Go modules (via setup-go) and installed tools (golangci-lint and swag) to optimize performance.

Original prompt

This section details on the original issue you should resolve

<issue_title>Prepare workflow for automated agent development</issue_title>
<issue_description>Here is a simple example of a copilot-setup-steps.yml file for a TypeScript project that clones the project, installs Node.js and downloads and caches the project's dependencies. You should customize this to fit your own project's language(s) and dependencies:

name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

jobs:
  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
  copilot-setup-steps:
    runs-on: ubuntu-latest

    # Set the permissions to the lowest permissions possible needed for your steps.
    # Copilot will be given its own token for its operations.
    permissions:
      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
      contents: read

    # You can define any steps you want, and they will run before the agent starts.
    # If you do not check out your code, Copilot will do this for you.
    steps:
      - name: Checkout code
        uses: actions/checkout@v5

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install JavaScript dependencies
        run: npm ci

The workflow should:

  • install go 1.24 and all project dependencies using go mod tidy
  • Install golangci
  • install swag cli tool</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI changed the title [WIP] Prepare workflow for automated agent development Add copilot-setup-steps workflow for automated agent development Dec 7, 2025
Copilot AI requested a review from HermanPlay December 7, 2025 16:54
@HermanPlay
Copy link
Member

change ubuntu-latest to ubuntu-mini
@copilot

Copy link
Contributor Author

Copilot AI commented Dec 7, 2025

change ubuntu-latest to ubuntu-mini
@copilot

Changed to ubuntu-mini in commit bfecbf0

@HermanPlay HermanPlay marked this pull request as ready for review December 7, 2025 18:27
@HermanPlay HermanPlay requested a review from a team as a code owner December 7, 2025 18:27
Copilot AI review requested due to automatic review settings December 7, 2025 18:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new GitHub Actions workflow (copilot-setup-steps.yml) to prepare the development environment for Copilot coding agents. The workflow automates the setup of Go, project dependencies, and required tools (golangci-lint v2 and swag CLI) before agent operations begin. It supports both manual triggering and automatic validation when the workflow file is modified.

Key Changes:

  • New workflow with proper job naming (copilot-setup-steps) required by Copilot
  • Go 1.24 setup with dependency caching and installation via go mod tidy
  • Installation of critical development tools: golangci-lint v2 and swag CLI

Copilot AI and others added 3 commits December 7, 2025 19:29
Co-authored-by: HermanPlay <78978614+HermanPlay@users.noreply.github.com>
Co-authored-by: HermanPlay <78978614+HermanPlay@users.noreply.github.com>
Co-authored-by: HermanPlay <78978614+HermanPlay@users.noreply.github.com>
@HermanPlay HermanPlay force-pushed the copilot/prepare-workflow-for-automation branch from bfecbf0 to 0b0290d Compare December 7, 2025 18:29
@HermanPlay
Copy link
Member

@copilot address review comments.

Add caching to speed up the process

…it/swag fork, and add caching

Co-authored-by: HermanPlay <78978614+HermanPlay@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot address review comments.

Add caching to speed up the process

All review comments addressed in commit 0ed4304:

  • Changed runner to ubuntu-latest (ubuntu-mini is not a valid runner type)
  • Using go-version-file: go.mod for consistency with docs.yaml workflow
  • Using github.com/mini-maxit/swag fork instead of upstream swaggo/swag
  • Added caching for Go modules (~/.cache/go-build and ~/go/pkg/mod)
  • Added caching for installed tools (~/go/bin)

…ache: true)

Co-authored-by: HermanPlay <78978614+HermanPlay@users.noreply.github.com>
Copilot AI requested a review from HermanPlay December 7, 2025 18:38
@HermanPlay HermanPlay merged commit 8f14808 into master Dec 7, 2025
13 checks passed
@HermanPlay HermanPlay deleted the copilot/prepare-workflow-for-automation branch December 7, 2025 18:49
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.

Prepare workflow for automated agent development

2 participants