agentleFS
JamesIvesJamesIves/github-pages-deploy-action/.github/copilot-instructions.md

github-pages-deploy-action

Copilot instructions4.6k starsChanged 2 years agoMITView on GitHub

This is a GitHub Action that automatically deploys your project to GitHub Pages with GitHub Actions. The action can be configured to push your production-ready code into any branch you'd like, including gh-pages and docs. It supports cross-repository deployments, works with GitHub Enterprise, and provides multiple authentication methods including SSH keys and personal access tokens. Always follow these instructions first and only fallback to additional search and context gathering if the information in these instructions is incomplete or found to…

  • Installs packages

We split this copilot-instructions.md into the rules it gives an agent

18 rules. About 1 is common, 1 is distinctive, and 16 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Common:

    Always follow these instructions first and only fallback to additional search and context gathering if the information in these …

    line 5
  2. Very specific:

    Use Node.js version from .node-version file

    line 11
  3. Very specific:

    Run tests: yarn test -- takes 8 seconds.

    line 15
  4. Very specific:

    Check linting: yarn lint:check -- takes 3 seconds.

    line 16
  5. Very specific:

    Check formatting: yarn lint:format:check -- takes 2 seconds.

    line 17
  6. Distinctive:

    ALWAYS run the bootstrapping steps first (install dependencies and build)

    line 21
  7. Very specific:

    Run yarn test to ensure tests pass

    line 24
  8. Very specific:

    Run yarn lint:check and yarn lint:format:check before committing

    line 25
  9. Very specific:

    ALWAYS run yarn build after making changes - the action depends on compiled JavaScript in lib/

    line 36
  10. Very specific:

    ALWAYS run yarn test to ensure all unit tests pass

    line 37
  11. Very specific:

    ALWAYS run yarn lint:check and yarn lint:format:check or the CI will fail

    line 38
  12. Very specific:

    Ensure all TypeScript compiles without errors: yarn build

    line 51
  13. Very specific:

    Ensure all tests pass: yarn test

    line 52
  14. Very specific:

    Ensure code follows style guidelines: yarn lint:check and yarn lint:format:check

    line 53
  15. Very specific:

    All git commands go through execute() wrapper for consistent logging

    line 98
  16. Very specific:

    Check TypeScript compilation errors first: yarn build

    line 111
  17. Very specific:

    Run specific test files: yarn test <filename>

    line 112
  18. Very specific:

    Use yarn lint to auto-fix linting issues

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

GitHub Pages Deploy Action

This is a GitHub Action that automatically deploys your project to GitHub Pages with GitHub Actions. The action can be configured to push your production-ready code into any branch you'd like, including gh-pages and docs. It supports cross-repository deployments, works with GitHub Enterprise, and provides multiple authentication methods including SSH keys and personal access tokens.

Always follow these instructions first and only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.

Working Effectively

Bootstrap and build the repository:

  • Use Node.js version from .node-version file
  • Install Yarn globally: npm install -g yarn
  • Install dependencies: yarn install --frozen-lockfile -- takes 1-25 seconds depending on cache state
  • Build the project: yarn build -- takes 9 seconds. NEVER CANCEL. Set timeout to 30+ seconds
  • Run tests: yarn test -- takes 8 seconds. NEVER CANCEL. Set timeout to 30+ seconds
  • Check linting: yarn lint:check -- takes 3 seconds. Set timeout to 15+ seconds
  • Check formatting: yarn lint:format:check -- takes 2 seconds. Set timeout to 10+ seconds

Development workflow:

  • ALWAYS run the bootstrapping steps first (install dependencies and build)
  • Make code changes in the src/ directory (TypeScript source)
  • Build with yarn build to compile TypeScript to JavaScript in lib/ directory
  • Run yarn test to ensure tests pass
  • Run yarn lint:check and yarn lint:format:check before committing

Fix linting and formatting issues:

  • Auto-fix linting: yarn lint
  • Auto-format code: yarn lint:format

Validation

CRITICAL - Required validation steps:

  • ALWAYS run yarn build after making changes - the action depends on compiled JavaScript in lib/
  • ALWAYS run yarn test to ensure all unit tests pass
  • ALWAYS run yarn lint:check and yarn lint:format:check or the CI will fail
  • NEVER CANCEL any build or test commands - they complete quickly (under 30 seconds each)

Manual testing scenarios:

Since this is a GitHub Action, full end-to-end testing requires deploying to a test repository. However, you can validate:

  • Unit tests cover core functionality: yarn test runs 59 tests with 92%+ coverage
  • Integration tests exist in .github/workflows/integration.yml but require GitHub Actions environment
  • Build output in lib/ directory should match TypeScript source in src/

Before submitting changes:

  • Ensure all TypeScript compiles without errors: yarn build
  • Ensure all tests pass: yarn test
  • Ensure code follows style guidelines: yarn lint:check and yarn lint:format:check
  • The lib/ directory must be committed for distribution branches (not for pull requests to dev)

Common Tasks

Repository structure:

src/               # TypeScript source files
├── main.ts        # Entry point for GitHub Action
├── lib.ts         # Main run function (can be used as module)
├── constants.ts   # Configuration interfaces and constants
├── git.ts         # Git operations for deployment
├── util.ts        # Utility functions
├── ssh.ts         # SSH key configuration
├── execute.ts     # Command execution wrapper
└── worktree.ts    # Git worktree operations

__tests__/         # Jest test files
lib/               # Compiled JavaScript (generated, do not edit)
integration/       # Sample files for testing deployments
.github/workflows/ # CI/CD workflows

Key files and their purposes:

  • action.yml - GitHub Action definition with inputs/outputs
  • package.json - Dependencies and npm scripts
  • tsconfig.json - TypeScript compilation settings
  • jest.config.js - Test configuration
  • eslint.config.mjs - Linting rules (ignores lib/ directory)
  • .node-version - Required Node.js version

Understanding the codebase:

  • Entry Point: src/main.ts imports and calls the run() function from src/lib.ts
  • Core Logic: src/lib.ts contains the main deployment logic
  • Git Operations: src/git.ts handles repository initialization and deployment
  • Configuration: src/constants.ts defines interfaces for action parameters
  • Testing: Comprehensive Jest tests in __tests__/ directory with mocks for GitHub Actions

Common development patterns:

  • Action parameters are defined in src/constants.ts interfaces
  • Error handling uses try/catch with extractErrorMessage() utility
  • All git commands go through execute() wrapper for consistent logging
  • SSH and token authentication are handled in separate modules
  • Extensive parameter validation in src/util.ts

CI/CD behavior:

  • .github/workflows/build.yml runs on every push and PR
  • Linting, formatting, tests, and build must all pass
  • Integration tests deploy to test repositories using various authentication methods
  • Production releases include node_modules in distribution branches

Debugging and troubleshooting:

  • Check TypeScript compilation errors first: yarn build
  • Run specific test files: yarn test <filename>
  • Use yarn lint to auto-fix linting issues
  • The action supports debug mode via GitHub Actions debug logging
  • Integration tests in CI provide real deployment validation

Important notes:

  • The lib/ directory is compiled output and should not be manually edited
  • Distribution branches (like v4) include node_modules and lib/ for GitHub Actions runtime
  • The dev branch excludes node_modules and lib/ from version control
  • SSH key support allows deployment with repository deploy keys
  • Cross-repository deployment is supported with proper token permissions

Environment requirements:

  • Node.js (specified in .node-version)
  • Yarn package manager
  • Git (for deployment operations)
  • rsync (for file operations, automatically available in GitHub Actions runners)

Performance expectations:

  • Fresh install: ~25 seconds for yarn install --frozen-lockfile
  • Cached install: ~1 second for yarn install --frozen-lockfile
  • Build: ~9 seconds for yarn build
  • Tests: ~8 seconds for yarn test
  • Linting: ~3 seconds for yarn lint:check
  • Formatting: ~2 seconds for yarn lint:format:check

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about JamesIves/github-pages-deploy-action

The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 54

Talked about on GitHub, Stack Overflow and Hacker News (54 times).

On GitHub · 50

45 more on GitHub
  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.