You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+35-5Lines changed: 35 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,19 @@
2
2
3
3
## scripts in the `gh-cli` and `scripts` directories
4
4
5
-
When creating or modifying scripts in the `gh-cli`directory, ensure:
5
+
When creating or modifying scripts in the `gh-cli`and `scripts` directories:
6
6
7
-
- The script has input parameters
8
-
- The script has a basic description and usage examples at the top
9
-
- We make sure to paginate (`--paginate`) when retrieving results
7
+
- Ensure the script has input parameters
8
+
- Include input validation and meaningful error messages
9
+
- Ensure the script has a basic description and usage examples at the top
10
+
- Make sure to paginate (`--paginate` and/or `octokit.paginate`) when retrieving results
10
11
- Note any special permissions/token requirements
11
12
- If modifying input parameters to a script, make sure to update the respective `README.md` in the script directory (if applicable)
12
13
- Use only `2` spaces for indentation - not `4`
13
14
- Do not leave any trailing whitespace at the end of lines
15
+
- With `gh api` commands, prefer `--jq` versus piping to `jq` when possible
16
+
- Include the header `-H "X-Github-Next-Global-ID: 1"` in GraphQL queries to retrieve the new global ID format - see the [GitHub migration guide for global node IDs](https://docs.github.com/en/graphql/guides/migrating-graphql-global-node-ids) for details
17
+
- Complex scripts in the `./scripts` directory should have its own folder (so a `package.json` can be included for example)
14
18
15
19
## README.md documentation
16
20
@@ -23,8 +27,10 @@ When adding new scripts to any directory:
23
27
- Use proper kebab-case naming convention for script files
24
28
- Avoid short words like "repo" (use "repository"), "org" (use "organization")
25
29
- Test that the entry passes `lint-readme.js` validation
30
+
- Don't be too verbose - keep descriptions and usage instructions concise and to the point
31
+
- Don't use periods after bullet points for consistency
26
32
27
-
## Script naming and structure
33
+
## script naming and structure
28
34
29
35
- Use kebab-case for all script filenames (e.g., `get-organization-repositories.sh`)
30
36
- Include appropriate file extensions (.sh, .ps1, .js, .py)
@@ -39,3 +45,27 @@ When adding new scripts to any directory:
39
45
- Document required scopes and permissions in script comments
40
46
- Use environment variables or parameters for sensitive data (never hardcode tokens)
41
47
- For scripts requiring special permissions, mention this in both script comments and README
48
+
- Add hostname support for GitHub Enterprise instances / ghe.com when applicable
49
+
50
+
## commit messages
51
+
52
+
Prefer the Conventional Commits specification:
53
+
54
+
- Format: `<type>(<scope>): <description>`
55
+
- Types:
56
+
-`feat`: New feature
57
+
-`fix`: Bug fix
58
+
-`refactor`: Code change that neither fixes a bug nor adds a feature
59
+
-`docs`: Documentation only changes
60
+
-`chore`: Changes to build process or auxiliary tools
61
+
-`ci`: Changes to CI configuration files and scripts
0 commit comments