Skip to content

Commit 60501b1

Browse files
committed
📝 docs(repo_management_files/errorswarningsresolutions.md): added errors and resolutions from medium post
copied over errors and resolutions that I wrote about on medium.com
1 parent 49526bc commit 60501b1

File tree

2 files changed

+138
-19
lines changed

2 files changed

+138
-19
lines changed

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,89 +139,89 @@
139139
"cz-gitmoji-adapter": {
140140
"scopes": [
141141
".depcheckrc.json",
142-
".eslintrc.json",
143142
".eslintignore",
143+
".eslintrc.json",
144144
".gitignore",
145145
".prettierignore",
146+
".prettierrc.json",
146147
"license",
147148
"readme-api.md",
148-
".prettierrc.json",
149149
"readme.md",
150150
"commit-template.hbs",
151-
"default-template.hbs",
152151
"commitlint.config.ts",
152+
"default-template.hbs",
153153
"jest.config.json",
154-
"package-lock.json",
155154
"package.json",
155+
"package-lock.json",
156156
"release.config.ts",
157157
"renovate.json",
158158
"tsconfig.json",
159159
"typedoc.json",
160160
".vscode/settings.json",
161161
"public/.gitkeep",
162162
"repo_management_files/auditchecklist.md",
163-
"repo_management_files/branchnamingconventions.md",
164163
"repo_management_files/cz-emoji-template-extract.js",
165164
"repo_management_files/cz-emoji-type-extract.js",
166165
"repo_management_files/cz-type-extract.js",
167166
"repo_management_files/directorystructuredocument.md",
168-
"repo_management_files/errorswarningsresolutions.md",
169167
"repo_management_files/extractfilescopes.js",
168+
"repo_management_files/errorswarningsresolutions.md",
170169
"repo_management_files/fileswithgitmojis.md",
171-
"repo_management_files/genericcommitmessages.md",
170+
"repo_management_files/branchnamingconventions.md",
172171
"repo_management_files/gitmojisemver-extract.js",
173172
"repo_management_files/initializationinfo.md",
174-
"repo_management_files/issues.sh",
173+
"repo_management_files/genericcommitmessages.md",
175174
"repo_management_files/labels.sh",
176175
"repo_management_files/packagejsondocument.md",
177176
"repo_management_files/usefultipsandtricks.md",
177+
"repo_management_files/issues.sh",
178178
".github/dependabot.yml",
179179
".github/workflows/build.yml",
180-
".github/workflows/depcheck.yml",
181180
".github/workflows/docs.yml",
182181
".github/workflows/lint.yml",
183182
".github/workflows/pr.yml",
184183
".github/workflows/release.yml",
184+
".github/workflows/depcheck.yml",
185185
".github/workflows/test.yml",
186186
".husky/commit-msg",
187187
".husky/pre-commit",
188188
".husky/prepare-commit-msg",
189189
".husky/_/.gitignore",
190-
".husky/_/applypatch-msg",
191190
".husky/_/commit-msg",
192191
".husky/_/h",
193192
".husky/_/post-applypatch",
193+
".husky/_/applypatch-msg",
194194
".husky/_/post-checkout",
195-
".husky/_/post-commit",
196195
".husky/_/post-merge",
197196
".husky/_/post-rewrite",
198197
".husky/_/pre-applypatch",
199198
".husky/_/pre-auto-gc",
200-
".husky/_/pre-push",
199+
".husky/_/post-commit",
201200
".husky/_/pre-rebase",
202201
".husky/_/pre-commit",
203202
".husky/_/prepare-commit-msg",
203+
".husky/_/pre-push",
204204
"src/app.ts",
205-
"src/configs/.gitkeep",
206-
"src/middleware/.gitkeep",
207205
"src/bin/.gitkeep",
208-
"src/plugins/.gitkeep",
209206
"src/controllers/.gitkeep",
207+
"src/middleware/.gitkeep",
210208
"src/routes/.gitkeep",
209+
"src/plugins/.gitkeep",
210+
"src/configs/.gitkeep",
211211
"src/models/.gitkeep",
212212
"src/views/.gitkeep",
213213
"src/utils/.gitkeep",
214214
"test/app.test.ts",
215215
"test/.gitkeep",
216+
"test/controllers/.gitkeep",
217+
"test/bin/.gitkeep",
216218
"test/configs/.gitkeep",
217219
"test/middleware/.gitkeep",
218220
"test/plugins/.gitkeep",
221+
"test/views/.gitkeep",
219222
"test/routes/.gitkeep",
220223
"test/models/.gitkeep",
221-
"test/bin/.gitkeep",
222-
"test/views/.gitkeep",
223-
"test/utils/.gitkeep",
224-
"test/controllers/.gitkeep"
224+
"test/utils/.gitkeep"
225225
],
226226
"questions": {
227227
"scope": "Specify a scope: "

repo_management_files/errorsWarningsResolutions.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,125 @@
22

33
## Errors
44

5+
<!--
6+
### Error:
7+
8+
### Fix:
9+
-->
10+
11+
### Error: Commitlint Failed Messages
12+
13+
```bash
14+
husky — pre-commit script failed (code 1)
15+
16+
⧗ input: testing without cz
17+
✖ Your commit should start with gitmoji code. Please check the emoji code on https://gitmoji.dev/. [start-with-gitmoji]
18+
✖ subject may not be empty [subject-empty]
19+
type may not be empty [type-empty]
20+
21+
✖ found 3 problems, 0 warnings
22+
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
23+
```
24+
25+
### Fix: Commitlint Failed Messages
26+
27+
Run the following command to change the last commit message
28+
29+
```bash
30+
nano .git/COMMIT_EDITMSG
31+
```
32+
33+
Then modify the message to have the correct format.
34+
35+
Then press `CTRL+X`, then `y`, then `Enter` to save.
36+
37+
### Error: Releasing empty files error Message
38+
39+
```bash
40+
RequestError [HttpError]: Validation Failed: {“resource”:”ReleaseAsset”,”code”:”custom”,”field”:”size”,”message”:”size must be greater than or equal to 1"}
41+
```
42+
43+
### Fix: Releasing empty files error Message
44+
45+
You need to add some text to the file to make the file size larger than 0 KB. I tried releasing just an empty .gitkeep file for testing purposes and the fix was to add a single character into the file. I used \* on the first line and saved. This error didn't show up anymore afterwords.
46+
47+
### Error: Release branches are invalid
48+
49+
```bash
50+
ERELEASEBRANCHES The release branches are invalid in the `branches` configuration.
51+
```
52+
53+
### Fix: Release branches are invalid
54+
55+
Check that you are on the same branch as you have in your release.config.ts file if not then do the following:
56+
57+
```bash
58+
git checkout -b {branch_name_in_your_release.config.ts_file}
59+
```
60+
61+
```bash
62+
# This template I uses 'main' as a release branch, in which case you would use:
63+
git checkout -b main
64+
#otherwise if you use a different release branch you would use it's name instead here.
65+
```
66+
67+
### Error: Missing GitHub token
68+
69+
```bash
70+
Fails with missing GitHub token when — dry-run and — no-ci
71+
72+
✘ An error occurred while running semantic-release: Error: Command failed with exit code 128: git ls-remote — heads https://github.com/{username}/{repo_name}
73+
74+
stderr: ‘remote: Support for password authentication was removed on August 13, 2021.\n’ +
75+
76+
SemanticReleaseError: No GitHub token specified.
77+
```
78+
79+
### Fix: Missing GitHub token
80+
81+
#### Set environment variables for current session
82+
83+
To set the environment variables for just this session run:
84+
85+
```bash
86+
export GH_TOKEN={your_GitHub_PAT}
87+
```
88+
89+
If you are using `gpg` to sign your commits then you will also need to set the following environment variables:
90+
91+
```bash
92+
export GIT_AUTHOR_NAME={your_gpg_author_name}; export GIT_AUTHOR_EMAIL={your_gpg_email_address}; export GIT_COMMITTER_NAME={your_gpg_author_name}; export GIT_COMMITTER_EMAIL={your_gpg_email_address}
93+
```
94+
95+
- Change {your_gpg_email_address} to the address you used when setting up your gpg key.
96+
97+
- Change {your_gpg_author_name} to the author name you used with your gpg key.
98+
99+
#### Set the environment variables for all future session
100+
101+
You will need to edit either your `$HOME/.bashrc` by running the following:
102+
103+
```bash
104+
nano ~/.bashrc
105+
```
106+
107+
At the end of the `.bashrc` file add the export statements below like so:
108+
109+
```bash
110+
export GH_TOKEN={your_GitHub_PAT}
111+
112+
export GIT_AUTHOR_NAME={your_gpg_author_name}
113+
export GIT_AUTHOR_EMAIL={your_gpg_email_address}
114+
export GIT_COMMITTER_NAME={your_gpg_author_name}
115+
export GIT_COMMITTER_EMAIL={your_gpg_email_address}
116+
```
117+
118+
Press `CTRL+X` then `Y` then `Enter` to save the changes. Next restart your terminal so the changes apply. Or run the command:
119+
120+
```bash
121+
source ~/.bashrc
122+
```
123+
5124
### Error: Missing or invalid credentials
6125
7126
```bash

0 commit comments

Comments
 (0)