diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..b41abea --- /dev/null +++ b/.github/copilot-instructions.md @@ -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 diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000..93074ab --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -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