-
Notifications
You must be signed in to change notification settings - Fork 146
Add GitHub Copilot instructions for repository #2352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
5
commits into
trunk
Choose a base branch
from
copilot/setup-copilot-instructions
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+62
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d18e77c
Initial plan
Copilot 718acaf
Add GitHub Copilot instructions file
Copilot 1ea1a5b
Refer to AGENTS.md
westonruter bbb0f56
Copy copilot-setup-steps.yml from GitHub docs
westonruter f057022
Customize copilot-setup-steps.yml
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Please see [AGENTS.md](../AGENTS.md). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| 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 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: npm | ||
|
|
||
| - name: Install pre-commit hook | ||
| run: npx husky | ||
|
|
||
| - name: Install JavaScript dependencies | ||
| run: npm ci | ||
|
|
||
| - uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0 | ||
| with: | ||
| php-version: latest | ||
|
|
||
| - name: Get Composer Cache Directory | ||
| id: composer-cache | ||
| run: | | ||
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-composer- | ||
|
|
||
| - name: Build assets | ||
| run: npm run build | ||
|
|
||
| - name: Install and start WordPress | ||
| run: npx wp-env start |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this? Copilot already supports
AGENTS.md, it should get picked up automatically.Providing
copilot-instructions.mdis an alternative, which of course GitHub will document first because it's theirs, but it's not needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Copilot nags if you don't have it, as seen in #2346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, heh, even this own PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But where does it nag about it? I think we should validate whether it's actually not respecting our
AGENTS.mdfile without having this extracopilot-instructions.md, or whether it's just that GitHub's nag is overly aggressive.If the latter, then that would be annoying, but it shouldn't justify changing the configuration - because having a file just to say "look in the other file", when it already anyway looks in the other file, is pointless and possibly even confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It nags about it in the PR description:
And I confirmed that
AGENTS.mdis respected: #2352 (comment)I wanted to see if adding the file would suppress the nag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth as a test, but even if it works, I don't think we should do it. That would be optimizing for the (apparently buggy) nag rather than actual AI behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems Copilot CLI isn't respecting
AGENTS.md: github/copilot-cli#489So having this additional pointer may be useful beyond suppressing a nag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's odd. I know in VS Code you can configure that for Copilot. So maybe there's a way to do it for Copilot running on GitHub too.