Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

  • Create .github/workflows/copilot-setup-steps.yml file with the required configuration
  • Ensure the workflow follows the structure from the issue description
  • Test that the workflow file is valid YAML and follows GitHub Actions syntax
  • Verify the workflow is properly configured for the wp-cli organization's needs
  • Add copilot-setup-steps.yml to sync-workflows.yml for distribution to all repositories
  • Add composer.json existence check to prevent running PHP/Composer steps in non-PHP projects
Original prompt

This section details on the original issue you should resolve

<issue_title>Add copilot-setup-steps.yml file to all repositories</issue_title>
<issue_description>As per the docs:

In its ephemeral development environment, Copilot can build or compile your project and run automated tests, linters and other tools. To do this, it will need to install your project's dependencies.

Copilot can discover and install these dependencies itself via a process of trial and error, but this can be slow and unreliable, given the non-deterministic nature of large language models (LLMs), and in some cases, it may be completely unable to download these dependencies—for example, if they are private.

Instead, you can preconfigure Copilot's environment before the agent starts by creating a special GitHub Actions workflow file, located at .github/workflows/copilot-setup-steps.yml within your repository.

A copilot-setup-steps.yml file looks like a normal GitHub Actions workflow file, but must contain a single copilot-setup-steps job. This job will be executed in GitHub Actions before Copilot starts working.

It could look like this:

name: "Copilot Setup Steps"

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

jobs:
  copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
      contents: read

    steps:
      - name: Checkout code
        uses: actions/checkout@v5

      - name: Set up PHP environment
        uses: shivammathur/setup-php@v2
        with:
          php-version: 'latest'
          ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
          coverage: 'none'
          tools: composer,cs2pr
        env:
          COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Install Composer dependencies & cache dependencies
        uses: ramsey/composer-install@v3
```</issue_description>

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

<comments>
</comments>

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

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add copilot-setup-steps.yml file to all repositories Add copilot-setup-steps.yml to configure GitHub Copilot environment Nov 13, 2025
Copilot AI requested a review from swissspidy November 13, 2025 14:26
@swissspidy

This comment was marked as resolved.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

This comment was marked as resolved.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@swissspidy swissspidy marked this pull request as ready for review November 13, 2025 14:44
@swissspidy swissspidy requested a review from a team as a code owner November 13, 2025 14:44
@swissspidy
Copy link
Member

@copilot Add a new "Check existence of composer.json file" step like in other workflows, for some extra hardening.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

@swissspidy swissspidy merged commit ccb9cd5 into main Dec 11, 2025
12 checks passed
@swissspidy swissspidy deleted the copilot/add-copilot-setup-steps-file branch December 11, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add copilot-setup-steps.yml file to all repositories

2 participants