Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# GitHub Action: Text Variables

This is a JavaScript-based GitHub Action that replaces mustache-style variables
(`{{ variable }}`) in text templates. The action is designed to enable dynamic
content creation for GitHub workflows, particularly for customizing Issue/PR
descriptions, comments, and other text content.

## Code Standards

### Required Before Each Commit

- Run `npm run format:write` to format code with Prettier
- Run `npm run lint` to check code with ESLint
- Run `npm run test` to execute all tests
- Run `npm run all` to run the complete validation pipeline (format, lint, test,
coverage, package)

## Repository Structure

- `src/`: Core JavaScript source code
- `index.js`: Entry point for the action
- `main.js`: Main logic for template processing and variable replacement
- `__tests__/`: Jest test files and sample templates
- `action.yml`: GitHub Action metadata and input/output definitions
- `dist/`: Compiled/bundled output (generated, do not edit directly)

## Code Quality

1. Follow JavaScript best practices and Node.js conventions
1. Use async/await for asynchronous operations
1. Write comprehensive Jest tests for unit testing.
1. Write integration tests for end-to-end validation of the GitHub Action using
workflows in `.github/workflows/ci.yml`
1. Use descriptive variable names and add comments for complex logic
30 changes: 30 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Copilot Setup Steps'

on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

permissions:
contents: read

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
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: 'npm'

- name: Install JavaScript dependencies
run: npm ci