Skip to content

Commit b72d5c9

Browse files
committed
refactor: moved pre-receeive docs into website/docs
1 parent 407e6e2 commit b72d5c9

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

docs/pre-receive.md renamed to website/docs/configuration/pre-receive.mdx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Pre-Receive Hook Documentation
1+
---
2+
title: 'Pre-Receive Hook'
3+
---
24

35
## Overview
46

5-
The `pre-receive` hook is a critical component of the Git Proxy system. It is executed before changes are accepted into a repository. This hook allows for custom logic to validate or reject incoming changes based on specific criteria, ensuring that only valid and authorized changes are pushed to the repository.
7+
The `pre-receive` hook is a critical component of the GitProxy system. It is executed before changes are accepted into a repository. This hook allows for custom logic to validate or reject incoming changes based on specific criteria, ensuring that only valid and authorized changes are pushed to the repository.
68

79
## Functionality
810

@@ -17,18 +19,21 @@ The `pre-receive` hook determines the outcome of a push based on the exit status
1719

1820
To use the `pre-receive` hook, follow these steps:
1921

20-
- **Create a Hook Script**:
21-
Write a shell script or executable file that implements your custom validation logic. The script must accept input in the format: `<old_commit_hash> <new_commit_hash> <branch_name>`.
22+
### Create a Hook Script
2223

23-
- **Place the Script**:
24-
Save the script in the appropriate directory, such as `hooks/pre-receive.sh`.
24+
Write a shell script or executable file that implements your custom validation logic. The script must accept input in the format: `<old_commit_hash> <new_commit_hash> <branch_name>`.
2525

26-
- **Make the Script Executable**:
27-
Ensure the script has executable permissions. You can do this by running the following command:
26+
### Place the Script
2827

29-
```bash
30-
chmod +x hooks/pre-receive.sh
31-
```
28+
Save the script in the appropriate directory, such as `hooks/pre-receive.sh`.
29+
30+
### Make the Script Executable
31+
32+
Ensure the script has executable permissions. You can do this by running the following command:
33+
34+
```bash
35+
chmod +x hooks/pre-receive.sh
36+
```
3237

3338
> **Note**: If the `pre-receive` script does not exist, the hook will not be executed, and the push will proceed without validation.
3439

website/sidebars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
},
3030
collapsible: true,
3131
collapsed: false,
32-
items: ['configuration/overview', 'configuration/reference'],
32+
items: ['configuration/overview', 'configuration/reference', 'configuration/pre-receive'],
3333
},
3434
{
3535
type: 'category',
@@ -44,6 +44,6 @@ module.exports = {
4444
collapsible: true,
4545
collapsed: false,
4646
items: ['development/contributing', 'development/plugins'],
47-
}
47+
},
4848
],
4949
};

0 commit comments

Comments
 (0)