Skip to content

Commit fe23929

Browse files
committed
update contributing
1 parent 71af9ce commit fe23929

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

devel/contributing.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,32 @@ Familiarize yourself with the best practices for [releasing and maintaining GitH
1313
Changes should be made on a new branch. The new branch should be merged to the main branch via a pull request. Ensure that all of the CI pipeline checks and tests have passed for your changes.
1414

1515
After the pull request has been approved and merged to main, follow the Github process for [creating a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository). The release must follow semantic versioning (ex: vX.Y.Z). This will kick off a new pipeline execution, and the action will automatically be published to the GitHub Actions Marketplace if the pipeline finishes successfully. Check the [GitHub Marketplace](https://github.com/marketplace/actions/setup-matlab) and check the major version in the repository (ex: v1 for v1.0.0) to ensure that the new semantically versioned tag is available.
16+
17+
## Adding a Pre-Commit Hook
18+
19+
You can run all CI checks before each commit by adding a pre-commit hook. To do so, navigate to the repository root folder and run the following commands:
20+
21+
_bash (Linux/macOS)_
22+
23+
```sh
24+
echo '#!/bin/sh' > .git/hooks/pre-commit
25+
echo 'npm run ci' >> .git/hooks/pre-commit
26+
chmod +x .git/hooks/pre-commit
27+
```
28+
29+
_Command Prompt (Windows)_
30+
31+
```cmd
32+
echo #!/bin/sh > .git\hooks\pre-commit
33+
echo npm run ci >> .git\hooks\pre-commit
34+
```
35+
36+
_PowerShell (Windows)_
37+
38+
```pwsh
39+
Set-Content .git\hooks\pre-commit '#!/bin/sh'
40+
Add-Content .git\hooks\pre-commit 'npm run ci'
41+
```
42+
43+
> **Note:**
44+
> Git hooks are not version-controlled, so you need to set up this hook for each fresh clone of the repository.

0 commit comments

Comments
 (0)