Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 26, 2025

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

  • Created .github/workflows/copilot-setup-steps.yml workflow file for GitHub Copilot agent setup
  • Added comprehensive CI workflow: Created .github/workflows/ci.yml with security hardening and full build pipeline
  • Added the missing .github/workflows/ directory structure
  • Migrated from npm to Yarn: Removed package-lock.json and generated yarn.lock for dependency management
  • Added Yarn PnP support: Generated .pnp.cjs and .pnp.loader.mjs files for Yarn Plug'n'Play
  • Updated biome.json: Added .pnp.* to ignored files to exclude Yarn PnP files from linting

Copilot Setup Workflow Features

The copilot-setup-steps workflow provides automated setup steps that will run before GitHub Copilot agents start working on issues:

  • Automatic triggers: Runs when the workflow file itself is modified (push/PR)
  • Manual execution: Can be triggered manually through the GitHub Actions tab for testing
  • Environment setup: Configures Node.js 20 with Yarn caching for optimal performance
  • Corepack integration: Enables Corepack to use the project's specified Yarn 4.9.2 version
  • Dependency installation: Runs yarn install --immutable for clean, reproducible dependency installation
  • Minimal permissions: Uses only contents: read for security

Continuous Integration Workflow Features

The CI workflow provides comprehensive automated testing and validation:

  • Security hardening: Uses step-security/harden-runner@v2 with audit egress policy
  • Branch targeting: Runs on main branch pushes and pull requests
  • Modern tooling: Uses latest stable actions (checkout@v4, setup-node@v4)
  • Yarn version enforcement: Automatically sets and uses Yarn 4.9.2 via Corepack
  • Complete pipeline: Lint → Build → Test execution with proper error handling

Technical Details

Both workflows follow GitHub Actions best practices:

  • Copilot workflow: Job named copilot-setup-steps as required for Copilot recognition
  • CI workflow: Uses CI environment for proper isolation and security
  • Uses latest stable action versions with proper Yarn caching
  • Includes Corepack enable step to support Yarn 4.9.2 as specified in package.json
  • Comprehensive comments explaining each configuration choice

Validation

All setup steps and CI pipeline have been tested and verified:

  • ✅ Clean yarn install --immutable installation completes successfully
  • ✅ TypeScript compilation works (yarn run build)
  • ✅ Biome linting passes with PnP files properly excluded (yarn run lint)
  • ✅ Test suite runs successfully (3 tests passing)
  • ✅ YAML syntax validated for both workflows
  • ✅ Yarn 4.9.2 with Corepack integration verified
  • ✅ Security hardening steps validated

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

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

# 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

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

Copilot AI changed the title 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... Add GitHub Actions workflow for Copilot setup steps Sep 26, 2025
Copilot AI requested a review from joe10832 September 26, 2025 19:32
Copilot finished work on behalf of joe10832 September 26, 2025 19:32
@joe10832
Copy link
Member

@copilot

@joe10832 joe10832 marked this pull request as ready for review September 29, 2025 19:56
Copilot AI review requested due to automatic review settings September 29, 2025 19:56
Copy link
Contributor

Copilot AI left a 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.yml workflow 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

Comment on lines 35 to 38
cache: "npm"

- name: Install JavaScript dependencies
run: npm ci No newline at end of file
Copy link

Copilot AI Sep 29, 2025

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.

Suggested change
cache: "npm"
- name: Install JavaScript dependencies
run: npm ci
cache: "yarn"
- name: Install JavaScript dependencies
- run: yarn install --immutable @copilot

Copilot uses AI. Check for mistakes.
Copy link
Member

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

Copy link
Member

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

Copy link
Member

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

Copy link
Member

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

Copy link
Member

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

Copilot AI requested a review from joe10832 September 29, 2025 19:57
Copilot finished work on behalf of joe10832 September 29, 2025 19:57
Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

@joe10832
Copy link
Member

run: yarn cache: 'yarn' run: yarn install --immutable instead.

@joe10832
Copy link
Member

cache: 'yarn' run: yarn run: yarn install --immutable @copilot

Copy link
Contributor Author

Copilot AI commented Sep 29, 2025

/.github/copilot-instructions.md
/.github/instructions/**/*.instructions.md
**/AGENTS.md
/CLAUDE.md
/GEMINI.md

run: yarn cache: 'yarn' run: yarn install --immutable instead.

Updated the workflow to use cache: 'yarn' and yarn install --immutable as requested. The workflow now properly supports Yarn 4.9.2 with Corepack enabled (commit ef159ad).

cache: 'yarn' run: yarn run: yarn install --immutable @copilot

The workflow has been updated to use yarn with the correct configuration - cache: 'yarn' and yarn install --immutable - along with Corepack support for the project's specified [email protected] version (commit ef159ad).

Copilot AI changed the title Add GitHub Actions workflow for Copilot setup steps Add GitHub Actions workflow for Copilot setup steps with Yarn support Sep 29, 2025
Copilot AI requested a review from joe10832 September 29, 2025 22:23
Copilot finished work on behalf of joe10832 September 29, 2025 22:23
@joe10832
Copy link
Member

name: Continuous Integration

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
environment: CI

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 

@joe10832 joe10832 removed their assignment Sep 29, 2025
@joe10832 joe10832 linked an issue Sep 29, 2025 that may be closed by this pull request
@joe10832
Copy link
Member

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

Copy link
Contributor Author

Copilot AI commented Sep 29, 2025

steps:

  • name: Harden Runner
    uses: step-security/harden-runner@v2...

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

name: Continuous Integration

on:...

Added the comprehensive CI workflow as requested with security hardening, linting, building, and testing. Updated to use main branch and properly configured for Yarn 4.9.2 (commit 430108d).

Copilot AI changed the title Add GitHub Actions workflow for Copilot setup steps with Yarn support Add GitHub Actions workflows for Copilot setup and Continuous Integration with Yarn support Sep 29, 2025
Copilot AI requested a review from joe10832 September 29, 2025 23:34
Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @copilot

@joe10832
Copy link
Member

@copilot

Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

Copy link
Member

@joe10832 joe10832 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

@joe10832
Copy link
Member

joe10832 commented Oct 1, 2025

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@copilot

@joe10832
Copy link
Member

joe10832 commented Oct 1, 2025

cache: 'yarn' run: yarn run: yarn install --immutable @copilot

Copilot stopped work on behalf of joe10832 due to an error October 1, 2025 13:25
@joe10832 joe10832 linked an issue Oct 3, 2025 that may be closed by this pull request
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.

✨ Set up Copilot instructions README.md docs/node/overview.mdx

2 participants