-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add GitHub Actions workflows for Copilot setup and Continuous Integration with Yarn support #77
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: joe10832 <[email protected]>
|
@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.
Pull Request Overview
This PR adds a GitHub Actions workflow to enable automated setup steps for GitHub Copilot integration with the Onchain Test Kit repository. The workflow ensures proper environment configuration before Copilot agents begin working on issues.
Key changes:
- Created the
.github/workflows/copilot-setup-steps.ymlworkflow file with Node.js 20 setup and dependency installation - Added automated triggers for workflow validation and manual execution capability
- Configured minimal security permissions following GitHub Actions best practices
| cache: "npm" | ||
|
|
||
| - name: Install JavaScript dependencies | ||
| run: npm ci No newline at end of file |
Copilot
AI
Sep 29, 2025
•
edited by joe10832
Loading
edited by joe10832
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.
<issue_title>@copilot-setup-steps Update .github/workflows/ copilot-setup-steps.ymlgithub/workflows/copilot-setup-steps.yml file</issue_title>
<issue_description>@copilot-setup-steps Update .github/workflows/ copilot-setup-steps.ymlgithub/workflows/copilot-setup-steps.yml fileThe workflow uses npm for caching but the project actually uses yarn (version 4.9.2 as mentioned in the instructions). This mismatch could cause dependency resolution issues. Consider updating to use yarn with cache: 'yarn' and run: yarn install --immutable instead.
| cache: "npm" | |
| - name: Install JavaScript dependencies | |
| run: npm ci | |
| cache: "yarn" | |
| - name: Install JavaScript dependencies | |
| - run: yarn install --immutable @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.
.github/workflows/copilot-setup-steps.yml
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: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit -
name: Checkout Source
uses: actions/checkout@v4 -
name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' -
name: Enable Corepack and Enforce Yarn Version
run: |
corepack enable
yarn set version 4.9.2 -
name: Install Dependencies
run: yarn install -
name: Run Linter
run: yarn lint -
name: Build Project
run: yarn build -
name: Run Tests
run: yarn test@copilot : step-security/harden-runner@v2
with:
egress-policy: audit -
name: Checkout Source
uses: actions/checkout@v4 -
name: Set run: yarncache: 'yarn'.github/- workflows/@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.
@copilot-setup-steps github/workflows/copilot-setup-steps.yml fileUpdate .github/workflows/ copilot-setup-steps.yml
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 Update .github/workflows/ copilot-setup-steps.ymlgithub/workflows/copilot-setup-steps.yml file
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"
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<issue_title>@copilot-setup-steps Update .github/workflows/ copilot-setup-steps.ymlgithub/workflows/copilot-setup-steps.yml file</issue_title>
<issue_description>@copilot-setup-steps Update .github/workflows/ copilot-setup-steps.ymlgithub/workflows/copilot-setup-steps.yml file
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
Co-authored-by: Copilot <[email protected]>
|
run: yarn cache: 'yarn' run: yarn install --immutable instead. |
|
cache: 'yarn' run: yarn run: yarn install --immutable @copilot |
Co-authored-by: joe10832 <[email protected]>
|
/.github/copilot-instructions.md
Updated the workflow to use
The workflow has been updated to use yarn with the correct configuration - |
|
name: Continuous Integration on: permissions: jobs: |
|
steps:
|
Co-authored-by: joe10832 <[email protected]>
Created the CI workflow with the exact steps you specified, including the Harden Runner security step and proper Yarn 4.9.2 setup. All steps have been tested and validated to work correctly (commit 430108d).
Added the comprehensive CI workflow as requested with security hardening, linting, building, and testing. Updated to use |
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 |
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 Setup Steps" Automatically run the setup steps when they are changed to allow for easy validation, and
jobs: The job MUST be called copilot-setup-steps or it will not be picked up by Copilot. 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
|
|
cache: 'yarn' run: yarn run: yarn install --immutable @copilot |
This PR adds the required GitHub Actions workflows to enable GitHub Copilot integration and comprehensive CI/CD for the Onchain Test Kit repository, configured to use Yarn as the package manager.
What Changed
.github/workflows/copilot-setup-steps.ymlworkflow file for GitHub Copilot agent setup.github/workflows/ci.ymlwith security hardening and full build pipeline.github/workflows/directory structurepackage-lock.jsonand generatedyarn.lockfor dependency management.pnp.cjsand.pnp.loader.mjsfiles for Yarn Plug'n'Play.pnp.*to ignored files to exclude Yarn PnP files from lintingCopilot Setup Workflow Features
The copilot-setup-steps workflow provides automated setup steps that will run before GitHub Copilot agents start working on issues:
yarn install --immutablefor clean, reproducible dependency installationcontents: readfor securityContinuous Integration Workflow Features
The CI workflow provides comprehensive automated testing and validation:
step-security/harden-runner@v2with audit egress policymainbranch pushes and pull requestscheckout@v4,setup-node@v4)Technical Details
Both workflows follow GitHub Actions best practices:
copilot-setup-stepsas required for Copilot recognitionCIenvironment for proper isolation and securitypackage.jsonValidation
All setup steps and CI pipeline have been tested and verified:
yarn install --immutableinstallation completes successfullyyarn run build)yarn run lint)This enables both GitHub Copilot agents to work effectively on the repository and provides a robust CI/CD pipeline for maintaining code quality and ensuring all changes are properly validated.
Original prompt
💡 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.