Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 18, 2025

Overview

This PR adds support for syncing .github/copilot-instructions.md files across multiple repositories via pull requests, following the same pattern as the existing dependabot.yml sync feature.

Changes

New Action Inputs

Added two new inputs to action.yml:

  • copilot-instructions-md: Path to a copilot-instructions.md file to sync to target repositories
  • copilot-instructions-pr-title: Customizable PR title (defaults to chore: update copilot-instructions.md)

Implementation

Implemented syncCopilotInstructions() function that:

  • Reads the source copilot-instructions.md file from the specified path
  • Compares content with existing files in target repositories
  • Creates or updates .github/copilot-instructions.md via pull requests
  • Uses the GitHub API to ensure verified commits
  • Checks for existing open PRs to avoid duplicates
  • Supports dry-run mode for previewing changes

Usage Examples

Basic usage:

- name: Sync Copilot Instructions
  uses: joshjohanning/bulk-github-repo-settings-sync-action@v1
  with:
    github-token: ${{ steps.app-token.outputs.token }}
    repositories: 'owner/repo1,owner/repo2'
    copilot-instructions-md: './.github/copilot-instructions.md'

With per-repository overrides:

repos:
  - repo: owner/repo1
    copilot-instructions-md: './config/copilot/javascript-instructions.md'
  - repo: owner/repo2
    copilot-instructions-md: './config/copilot/python-instructions.md'
  - repo: owner/repo3  # Uses global default

Behavior

  • If .github/copilot-instructions.md doesn't exist in the target repo, it creates it and opens a PR
  • If it exists but content differs, it updates it via PR
  • If content is identical, no PR is created
  • Updates existing open PRs instead of creating duplicates
  • Supports per-repository overrides via YAML configuration

Testing

  • Added 8 comprehensive tests covering all scenarios (create, update, unchanged, PR exists, dry-run, error handling)
  • All 50 tests passing (42 existing + 8 new)
  • Code coverage maintained at 80%
  • Linting and formatting checks passed
  • Security scan completed with 0 vulnerabilities

Documentation

  • Updated README with complete usage examples
  • Added new section demonstrating copilot instructions syncing
  • Updated action inputs table with new parameters
  • Included per-repository override examples

Version

Bumped version from 1.1.1 to 1.2.0 (minor version increment for new feature)

Closes #[issue-number]

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:

  • img.shields.io
    • Triggering command: node /home/REDACTED/work/bulk-github-repo-settings-sync-action/bulk-github-repo-settings-sync-action/node_modules/.bin/make-coverage-badge-better --label-color #333 --output-path ./badges/coverage.svg (dns block)

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

Original prompt

This section details on the original issue you should resolve

<issue_title>Add ability to sync copilot instructions</issue_title>
<issue_description>Just like we are doing with the ability to sync a dependent.yml file. (.github/copilot-instructions.yml)</issue_description>

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

Fixes #17


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

Copilot AI and others added 3 commits October 18, 2025 16:33
Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to sync copilot instructions feat: Add ability to sync copilot instructions across repositories Oct 18, 2025
Copilot AI requested a review from joshjohanning October 18, 2025 16:46
Copilot finished work on behalf of joshjohanning October 18, 2025 16:46
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.

Add ability to sync copilot instructions

2 participants