-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions workflow for automated Copilot setup steps #20
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
Add GitHub Actions workflow for automated Copilot setup steps #20
Conversation
Co-authored-by: joe10832 <[email protected]>
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.
Pull Request Overview
This PR introduces a GitHub Actions workflow to automate environment setup for GitHub Copilot integration, ensuring proper configuration before Copilot agents begin working on repository issues.
- Automated Node.js 20 environment setup with npm dependency management
- Repository structure validation for Copilot instruction files
- Markdown syntax validation for documentation files
| echo "❌ .github/copilot-instructions.md missing" | ||
| exit 1 |
Copilot
AI
Sep 29, 2025
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.
The script exits with code 1 when the file is missing, which will fail the entire workflow. However, the subsequent steps check for the same file and handle it gracefully. This creates inconsistent behavior where missing files cause hard failures in some places but warnings in others.
| echo "❌ .github/copilot-instructions.md missing" | |
| exit 1 | |
| echo "⚠️ .github/copilot-instructions.md missing" |
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.
/opt/hostedtoolcache/node/20.19.5/x64/bin/npm config get cache
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.
Update .github/workflows/ copilot-setup-steps.yml @copilot
| if ! command -v markdownlint &> /dev/null; then | ||
| echo "Installing markdownlint for validation..." | ||
| npm install -g markdownlint-cli | ||
| fi |
Copilot
AI
Sep 29, 2025
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.
Installing markdownlint-cli globally every time the command is not found is inefficient. Consider using npx markdownlint-cli to run it without global installation, or add it as a project dependency to leverage npm caching.
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.
@copilot-setup-steps
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.
@copilot
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.
/opt/hostedtoolcache/node/20.19.5/x64/bin/npm config get cache # 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
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.
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 @copilot
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.
/opt/hostedtoolcache/node/20.19.5/x64/bin/npm config get cache
/home/runner/.npm @Copilot
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.
Update .github/workflows/ copilot-setup-steps.yml @copilot
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
joe10832
left a comment
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.
@copilot
joe10832
left a comment
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.
@copilot
|
@copilot |
|
/opt/hostedtoolcache/node/20.19.5/x64/bin/npm config get cache |
This PR adds a comprehensive GitHub Actions workflow to enable automated setup steps for GitHub Copilot integration with the repository. The workflow ensures proper environment configuration before Copilot agents begin working on issues.
Key Changes
Created
.github/workflows/copilot-setup-steps.ymlwith the following capabilities:Environment Setup
actions/setup-node@v4to set up Node.js 20 with npm caching enabled for faster subsequent runspackage.jsonand installs dependencies usingnpm ciwhen presentAutomated Triggers
.github/**,**.md,package*.json)workflow_dispatchwith configurable options:full: Complete setup with all validations and dependency installationvalidation-only: Repository structure and file validation onlydependencies-only: Focus on dependency installationRepository Validation
.github/copilot-instructions.mdand agent-specific guides.github/instructions/directory and lists available instruction filesmarkdownlint-clito validate syntax across all instruction and documentation filesSecurity Best Practices
contents: read(minimal required permissions)Comprehensive Reporting
Benefits for GitHub Copilot Agents
This workflow enables coding agents to:
npm ciThe workflow has been thoroughly tested locally and passes YAML validation, ensuring reliable execution in the GitHub Actions environment.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.