Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

Creates .github/workflows/copilot-setup-steps.yml to set up the Copilot agent workspace with dependency installation.

This required by #2522 because, otherwise, dependencies wouldn't be installed in agentic copilot sessions due to firewalls.

Changes

  • Created .github/workflows/copilot-setup-steps.yml with a single copilot-setup-steps job
  • Added workflow triggers for testing and validation:
    • workflow_dispatch for manual testing through the Actions tab
    • push and pull_request with path filters to automatically validate when the file changes
  • Added permissions: contents: read for repository checkout
  • Added workspace setup steps:
    • Checkout repository with actions/checkout@v5
    • Set up Node.js 20 with actions/setup-node@v6
    • Install pnpm with pnpm/action-setup@v4
    • Install project dependencies with pnpm install --frozen-lockfile
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:
    copilot-setup-steps:
        runs-on: ubuntu-latest
        permissions:
            contents: read
        steps:
            - uses: actions/checkout@v5
            - name: Use Node.js
              uses: actions/setup-node@v6
              with:
                  node-version: 20
            - name: Install pnpm
              uses: pnpm/action-setup@v4
            - name: Install dependencies
              run: pnpm install --frozen-lockfile

This configuration follows the GitHub Copilot documentation for customizing the agent environment and will be automatically applied to Copilot-managed workflows. The workspace setup ensures dependencies from pkg.pr.new and pkg.vc are properly installed.


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


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

@appwrite
Copy link

appwrite bot commented Oct 28, 2025

Console

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

You can use Avatars API to generate QR code for any text or URLs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 2 commits October 28, 2025 18:57
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copilot AI changed the title [WIP] Add action setup steps to ensure firewall compatibility Add harden-runner to workflows for pkg.pr.new and pkg.vc access Oct 28, 2025
Copilot AI requested a review from stnguyen90 October 28, 2025 19:00
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

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

@copilot As mentioned in https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment, the change should happen in .github/workflows/copilot-setup-steps.yml. A copilot-setup-steps.yml file looks like a normal GitHub Actions workflow file, but must contain a single copilot-setup-steps job.

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot As mentioned in https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment, the change should happen in `.github/workflows/copilot-setup-steps....

Done! Created .github/workflows/copilot-setup-steps.yml with the copilot-setup-steps job containing the harden-runner configuration, and reverted the changes to tests.yml and e2e.yml. (dffac54)

Copilot AI changed the title Add harden-runner to workflows for pkg.pr.new and pkg.vc access Add copilot-setup-steps.yml for pkg.pr.new and pkg.vc access Oct 29, 2025
Copilot AI requested a review from stnguyen90 October 29, 2025 07:43
@stnguyen90
Copy link
Contributor

@copilot This new action file should set up the workspace by installing dependencies rather than messing with firewalls.

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot This new action file should set up the workspace by installing dependencies rather than messing with firewalls.

Updated! The file now includes workspace setup steps: checkout, Node.js setup, pnpm installation, and dependency installation, along with the harden-runner configuration for firewall settings. (21e6822)

Copilot AI changed the title Add copilot-setup-steps.yml for pkg.pr.new and pkg.vc access Add copilot-setup-steps.yml for workspace setup and pkg.pr.new/pkg.vc access Oct 29, 2025
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Copilot AI changed the title Add copilot-setup-steps.yml for workspace setup and pkg.pr.new/pkg.vc access Add copilot-setup-steps.yml for workspace setup Oct 29, 2025
Copilot AI requested a review from stnguyen90 October 29, 2025 13:53
@stnguyen90 stnguyen90 marked this pull request as ready for review October 29, 2025 19:04
@@ -0,0 +1,17 @@
name: Copilot Setup Steps

on: []
Copy link
Contributor

Choose a reason for hiding this comment

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

This is dormant, no trigger here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like the agent just uses this as a reference so might be good, we can add a manual trigger to test if needed: https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot add the following so we can test this

# 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the workflow triggers for manual testing and automatic validation. (f92a590)

copilot-setup-steps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

latest is v5

Suggested change
- uses: actions/checkout@v4
- uses: actions/checkout@v5

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to actions/checkout@v5. (f92a590)

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

latest is v6

Suggested change
uses: actions/setup-node@v3
uses: actions/setup-node@v6

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to actions/setup-node@v6. (f92a590)

on: []

jobs:
copilot-setup-steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure to add permissions here if needed. Docs state:

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.

   permissions:
     contents: read

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added permissions: contents: read to the job. (f92a590)

@@ -0,0 +1,17 @@
name: Copilot Setup Steps

on: []
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot add the following so we can test this

# 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

on: []

jobs:
copilot-setup-steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

copilot-setup-steps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

… action versions

Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
@stnguyen90 stnguyen90 requested a review from EVDOG4LIFE October 30, 2025 16:55
@stnguyen90 stnguyen90 merged commit 33b884c into main Oct 30, 2025
9 checks passed
@stnguyen90 stnguyen90 deleted the copilot/add-action-setup-steps branch October 30, 2025 17:47
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.

4 participants