Skip to content

Add copilot-setup-steps.yml workflow for Copilot Coding Agent environment preparation#90

Merged
JReinhold merged 5 commits intonextfrom
copilot/add-copilot-setup-file
Nov 21, 2025
Merged

Add copilot-setup-steps.yml workflow for Copilot Coding Agent environment preparation#90
JReinhold merged 5 commits intonextfrom
copilot/add-copilot-setup-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 20, 2025

Adds .github/workflows/copilot-setup-steps.yml as a GitHub Actions workflow to optimize GitHub Copilot Coding Agent's repository interaction by pre-configuring the development environment.

Changes

  • Added .github/workflows/copilot-setup-steps.yml as a GitHub Actions workflow with:

    • Required copilot-setup-steps job name (for Copilot recognition)
    • Workflow triggers for automatic validation (workflow_dispatch, push, pull_request)
    • Minimal permissions (contents: read)
    • Three setup steps:
      1. Checkout code
      2. Setup Node.js and Install Dependencies (uses .github/actions/setup-node-and-install)
      3. Build all packages via Turbo (prerequisite for tests/linting/typechecking)
    • Properly formatted with single quotes per prettier configuration
  • Updated .github/copilot-instructions.md with new "Formatting and checks (CRITICAL)" section:

    • Documents mandatory formatting workflow for every commit
    • Emphasizes the importance of running pnpm run format and pnpm run check
    • Provides step-by-step instructions to ensure all checks pass before committing

This approach reuses the existing custom action to ensure consistency with CI workflows and includes all caching benefits (pnpm cache, Turbo cache).

Format

Follows GitHub's copilot-setup-steps.yml specification as a GitHub Actions workflow:

name: 'Copilot Setup Steps'

on:
  workflow_dispatch:
  push:
    paths:
      - .github/workflows/copilot-setup-steps.yml
  pull_request:
    paths:
      - .github/workflows/copilot-setup-steps.yml

env:
  TURBO_ENV_MODE: loose

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Checkout code
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - name: Setup Node.js and Install Dependencies
        uses: ./.github/actions/setup-node-and-install

      - name: Build packages
        run: pnpm turbo run build
Original prompt

Create a copilot-setup-steps.yml file based on the documentation here: https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment

The purpose is to speed up copilot's interaction with the repository. use the existing workflow files in the repo's .github/workflows directory to get a sense of what is necessary to prepare the repo for AI development.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 20, 2025

⚠️ No Changeset found

Latest commit: 2743e4e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@storybook/mcp-eval*" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copilot AI changed the title [WIP] Add copilot setup steps YAML file for agent environment Add copilot-setup-steps.yml for Copilot Coding Agent environment preparation Nov 20, 2025
Copilot AI requested a review from JReinhold November 20, 2025 22:11
Comment thread .github/copilot-setup-steps.yml Outdated
Comment on lines +8 to +16
- name: Install pnpm
run: |
# Install pnpm package manager (required by this monorepo)
npm install -g pnpm@10.19.0

- name: Install dependencies
run: |
# Install all dependencies for the monorepo with frozen lockfile
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot can't you use the "Setup Node.js" custom action we have in this repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion! Updated in 864479a to use the existing .github/actions/setup-node-and-install composite action instead of manually installing pnpm and dependencies. This makes it more maintainable and consistent with the CI workflows.

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
@JReinhold
Copy link
Copy Markdown
Contributor

@copilot looks like you didnt actually read the documentation link I sent in the original prompt. Try to read it.
If you can't, here's the example it gives, which you should try to follow, while still using our custom actions and requirements.

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

…kflow

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot looks like you didnt actually read the documentation link I sent in the original prompt. Try to read it.
If you can't, here's the example it gives, which you should try to follow, while still...

You're absolutely right - I misunderstood the documentation. Fixed in a7c3846:

  • Removed .github/copilot-setup-steps.yml (incorrect location and format)
  • Created .github/workflows/copilot-setup-steps.yml as a proper GitHub Actions workflow
  • Follows the example structure with the required copilot-setup-steps job name
  • Includes workflow triggers for validation and manual testing
  • Uses the existing custom action for setup

Copilot AI changed the title Add copilot-setup-steps.yml for Copilot Coding Agent environment preparation Add copilot-setup-steps.yml workflow for Copilot Coding Agent environment preparation Nov 20, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.13%. Comparing base (d8ce62a) to head (2743e4e).
⚠️ Report is 1 commits behind head on next.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             next      #90   +/-   ##
=======================================
  Coverage   89.13%   89.13%           
=======================================
  Files          19       19           
  Lines         414      414           
  Branches      116      116           
=======================================
  Hits          369      369           
  Misses          6        6           
  Partials       39       39           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JReinhold JReinhold marked this pull request as ready for review November 20, 2025 22:58
Copilot AI review requested due to automatic review settings November 20, 2025 22:58
Copy link
Copy Markdown
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 GitHub Actions workflow to optimize GitHub Copilot Coding Agent's repository interaction by pre-configuring the development environment. The workflow follows GitHub's official specification for copilot-setup-steps.yml and reuses existing repository patterns for consistency.

Key Changes

  • Adds .github/workflows/copilot-setup-steps.yml with the required copilot-setup-steps job name
  • Includes three essential setup steps: checkout, Node.js/dependency setup, and Turbo build
  • Configures automatic validation triggers on workflow changes and manual dispatch capability

@JReinhold
Copy link
Copy Markdown
Contributor

@copilot the formatting check is failing. you need to format your code. At the end of every commit you make, it's very important that you do:

# 1. format all code changes
pnpm run format

# 2. ensure all checks pass
pnpm run check

# 3. anaylze the check results, fix any failing checks
# repeat 2-3 until all checks pass

note this down in the main copilot instructions, with high importance.

…structions.md

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 21, 2025

@copilot the formatting check is failing. you need to format your code. At the end of every commit you make, it's very important that you do:

...

Fixed in 2743e4e:

  • Formatted the workflow file (changed double quotes to single quotes per prettier config)
  • Added a new "Formatting and checks (CRITICAL)" section to .github/copilot-instructions.md documenting the mandatory workflow:
    1. Make code changes
    2. Run pnpm run format
    3. Run pnpm run check
    4. Fix any failing checks and repeat until all pass
    5. Commit changes

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:

  • storybook.js.org
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/mcp/mcp/apps/internal-storybook/node_modules/.bin/../../../../node_modules/.pnpm/storybook@10.1.0-alpha.11_@testing-library&#43;dom@10.4.1_prettier@3.6.2_react-dom@18.3.1_r_be515867bd33527926d1952c03259f9a/node_modules/storybook/dist/bin/dis (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@JReinhold JReinhold merged commit ba30431 into next Nov 21, 2025
19 of 21 checks passed
@JReinhold JReinhold deleted the copilot/add-copilot-setup-file branch November 21, 2025 14:28
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.

4 participants