Skip to content

Commit 2520e77

Browse files
authored
Merge pull request #40 from GrantBirki/prepare-the-robots
Prepare the Robots 🤖
2 parents 3c0b589 + 1facc8e commit 2520e77

File tree

9 files changed

+739
-662
lines changed

9 files changed

+739
-662
lines changed

.github/copilot-instructions.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copilot Instructions
2+
3+
You are an AI assistant that specializes in software development for the JavaScript programming language. Specifically, you are an expert in using JavaScript to build custom (native) GitHub Actions.
4+
5+
## Environment Setup
6+
7+
Bootstrap the project by running:
8+
9+
```bash
10+
npm install
11+
```
12+
13+
## Testing
14+
15+
Ensure all unit tests pass by running the following:
16+
17+
```bash
18+
npm run test
19+
```
20+
21+
This project should include unit tests for everything.
22+
23+
This project **requires 100% test coverage** of code.
24+
25+
Unit tests should exist in the `__tests__` directory. They are powered by `jest`.
26+
27+
An important note about tests is that you might get a warning/error when running `npm run test` related to problems with the coverage badge due to network troubles. If this is the case, please swap to using `npm run ci-test` instead. This will run the tests and generate the coverage report without trying to create a coverage badge.
28+
29+
## Bundling
30+
31+
The final commit should always be a bundle of the code. This is done by running the following command:
32+
33+
```bash
34+
npm run all
35+
```
36+
37+
This uses Vercel's `ncc` to bundle JS code for running in GitHub Actions.
38+
39+
## Project Guidelines
40+
41+
- Follow:
42+
- Object-Oriented best practices, especially abstraction and encapsulation
43+
- GRASP Principles, especially Information Expert, Creator, Indirection, Low Coupling, High Cohesion, and Pure Fabrication
44+
- SOLID principles, especially Dependency Inversion, Open/Closed, and Single Responsibility
45+
- Base new work on latest `main` branch
46+
- Changes should maintain consistency with existing patterns and style.
47+
- Document changes clearly and thoroughly, including updates to existing comments when appropriate. Try to use the same "voice" as the other comments, mimicking their tone and style.
48+
- When responding to code refactoring suggestions, function suggestions, or other code changes, please keep your responses as concise as possible. We are capable engineers and can understand the code changes without excessive explanation. If you feel that a more detailed explanation is necessary, you can provide it, but keep it concise. After doing any refactoring, ensure to run `npm run test` to ensure that all tests still pass.
49+
- When suggesting code changes, always opt for the most maintainable approach. Try your best to keep the code clean and follow DRY principles. Avoid unnecessary complexity and always consider the long-term maintainability of the code.
50+
- When writing unit tests, try to consider edge cases as well as the main path of success. This will help ensure that the code is robust and can handle unexpected inputs or situations.
51+
- Hard-coded strings should almost always be constant variables.
52+
- In writing code, take the following as preferences but not rules:
53+
- understandability over concision
54+
- syntax, expressions, and blocks that are common across many languages over language-specific syntax.
55+
- more descriptive names over brevity of variable, function, and class names
56+
- the use of whitespace (newlines) over compactness of files
57+
- naming of variables and methods that lead to expressions and blocks reading more like English sentences.
58+
- less lines of code over more. Keep changes minimal and focused.
59+
60+
## Pull Request Requirements
61+
62+
- All tests must pass.
63+
- The linter must pass.
64+
- Documentation must be up-to-date.
65+
- The body of the Pull Request should:
66+
- contain a summary of the changes
67+
- make special note of any changes to dependencies
68+
- comment on the security of the changes being made and offer suggestions for further securing the code
69+
70+
## Repository Organization
71+
72+
- `.github/` - GitHub configurations and settings
73+
- `script/` - Repository maintenance scripts
74+
- `src/` - Main code for the project. This is where the main application/service code lives
75+
- `__tests__/` - Tests for the project. This is where the unit tests live
76+
- `dist/` - This is where the JS compiled code lives for the GitHub Action
77+
- `action.yml` - The GitHub Action file. This is where the GitHub Action is defined
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Allows you to test the setup steps from your repository's "Actions" tab
4+
on: workflow_dispatch
5+
6+
jobs:
7+
copilot-setup-steps:
8+
runs-on: ubuntu-latest
9+
# Set the permissions to the lowest permissions possible needed for *your steps*. Copilot will be given its own token for its operations.
10+
permissions:
11+
# 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.
12+
contents: read
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
19+
- name: setup node
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: .node-version
23+
cache: 'npm'
24+
25+
- name: install dependencies
26+
run: npm install

.github/workflows/json-yaml-validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
- uses: actions/checkout@v4
1818

1919
- name: json-yaml-validate
20-
uses: GrantBirki/json-yaml-validate@v2
20+
uses: GrantBirki/json-yaml-validate@v3
2121
with:
2222
comment: "true" # enable comment mode

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.6.0
1+
22.5.1

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)