This directory contains setup automation for GitHub Copilot Workspace environments.
Run the setup script once after opening the workspace:
bash .github/copilot-setup.shThis will:
- ✓ Check and install .NET SDK (version from
global.json) - ✓ Enable git hooks at
.githooks/ - ✓ Set
SKIP_AUTOFIX=0(auto-fix mode enabled) - ✓ Restore dotnet tools (nbgv)
- ✓ Install markdownlint-cli2
- ✓ Provide installation instructions for missing prerequisites
The script automatically detects and installs missing prerequisites:
-
.NET SDK - If not installed or wrong version, the script will:
- Download the .NET install script from Microsoft
- Install the exact version specified in
global.jsonto~/.dotnet - Add it to your PATH for the current session
- Provide instructions to persist the PATH change
-
Node.js/npm - If not installed, provides installation instructions:
- Direct download from https://nodejs.org/
- Or via nvm (Node Version Manager)
-
Git hooks - Always configured automatically
-
Linting tools - markdownlint-cli2 and dotnet tools (nbgv)
copilot-setup.sh- Setup script for Copilot Workspace (run manually)workflows/copilot-setup-steps.yml- GitHub Actions workflow for automated setup
The copilot-setup-steps.yml workflow can be triggered manually via:
gh workflow run copilot-setup-steps.ymlOr from the GitHub Actions UI:
- Go to Actions tab
- Select "Copilot Workspace Setup"
- Click "Run workflow"
| Feature | DevContainer | Copilot Workspace |
|---|---|---|
| .NET SDK install | Pre-installed in image | Auto-installed if missing |
| Node.js install | Pre-installed in image | Manual (with instructions) |
| Git hooks setup | Automatic (postCreate) | Automatic (in script) |
| SKIP_AUTOFIX | Set via containerEnv | Set via script |
| Dotnet tools | Automatic restore | Automatic restore |
| markdownlint-cli2 | Automatic install | Automatic install |
| Trigger | Container creation | Manual script execution |
| Variable | Default | Description |
|---|---|---|
SKIP_AUTOFIX |
0 |
Controls auto-fix mode (0=enabled, 1=check only) |
To persist SKIP_AUTOFIX across sessions, add to your shell profile:
echo 'export SKIP_AUTOFIX=0' >> ~/.bashrc
source ~/.bashrcAfter running the setup script, verify the configuration:
# Check git hooks path
git config --get core.hooksPath
# Should output: .githooks
# Check SKIP_AUTOFIX
echo $SKIP_AUTOFIX
# Should output: 0
# Verify dotnet tools
dotnet tool list
# Should include: nbgv
# Verify markdownlint
npx markdownlint-cli2 --help
# Should display help textIf you see the warning about SDK version mismatch, the script will attempt to install the correct version automatically. If automatic installation fails:
Manual installation options:
-
Using the dotnet-install script (Linux/macOS):
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 10.0.101 export PATH="$HOME/.dotnet:$PATH" export DOTNET_ROOT="$HOME/.dotnet"
-
Using the dotnet-install script (Windows PowerShell):
Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 ./dotnet-install.ps1 -Version 10.0.101
-
Direct download from Microsoft:
- Visit https://dotnet.microsoft.com/download/dotnet/10.0
- Download the SDK installer for your platform
- Run the installer
After installing, verify:
dotnet --version
# Should output: 10.0.101
dotnet --list-sdks
# Should include: 10.0.101 [path]Re-run the setup script:
bash .github/copilot-setup.shOr manually configure:
git config core.hooksPath .githooksThe script will warn but continue if the .NET SDK version doesn't match global.json. You can:
- Install the required SDK version (check
global.json) - Or update
global.jsonto use an installed SDK version
The script will provide installation instructions if Node.js/npm is not found. To install:
Visit https://nodejs.org/ and download the LTS version for your platform.
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Reload shell configuration
source ~/.bashrc
# Install Node.js LTS
nvm install --lts
# Verify installation
node --version
npm --versionAfter installing Node.js, re-run the setup script to install markdownlint-cli2.
- CONTRIBUTING.md - Git hooks documentation
- .githooks/pre-commit - Pre-commit hook implementation
- .devcontainer/ - DevContainer setup for VS Code/Codespaces
- .agents/retrospective/2025-12-14-automated-git-hooks-setup.md - Background on automated setup