Skip to content

Commit 89b8aa7

Browse files
committed
Updated documentation
1 parent 8402a9f commit 89b8aa7

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ tokens.json
33
build*
44
*.egg-info/
55
__pycache__/
6+
dist/*

README.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,43 @@ However due to the open ended nature of the blueprint this behavior can be easil
1111
During the setup be sure to pay close attention to any opportunities to input any sort of secret key.
1212
You will need that key later if you want to enable webhook verification **THIS IS SOMETHING THAT I GREATLY ADVISE YOU DO**.
1313
For GitHub that would be the secret string that you provide [during creation](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks#creating-a-repository-webhook) and for GitLab that would be the [secret token](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#validate-payloads-by-using-a-secret-token).
14-
2. Clone this repo or add it as a submodule
15-
3. Install packages from requirements.txt
16-
4. Create an instance of ```webhookBlueprint``` with your settings
17-
5. Register the instance within a Flask app of your choice
14+
2. Install this package
15+
- Using pip
16+
17+
```sh
18+
pip install gitAppWebhook
19+
```
20+
21+
- By cloning the repository
22+
23+
```sh
24+
git clone https://github.com/TCA166/gitWebhook.git
25+
pip install -r gitWebhook/requirements.txt
26+
```
27+
28+
- By including this repo as a submodule
29+
30+
```sh
31+
git submodule add https://github.com/example/repo.git gitWebhook
32+
pip install -r gitWebhook/requirements.txt
33+
```
34+
35+
3. Create an instance of ```webhookBlueprint``` with your settings
36+
37+
```python3
38+
import gitWebhook
39+
40+
wb = gitWebhook.webhookBlueprint(token, url_prefix="/")
41+
```
42+
43+
4. Register the instance within a Flask app of your choice
44+
45+
```python3
46+
from flask import Flask
47+
48+
app = Flask(__name__)
49+
app.register_blueprint(wb)
50+
```
1851

1952
If you are lost you can always look at official GitHub resources, or look at [wsgi.py](./wsgi.py) where an example configured Flask webapp is located.
2053

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "gitWebhook"
2+
name = "gitAppWebhook"
33
version = "0.1"
44
authors = [
55
{ name="TCA", email="[email protected]" },
@@ -9,7 +9,7 @@ readme = "README.md"
99
requires-python = ">=3.8"
1010
classifiers = [
1111
"Programming Language :: Python :: 3",
12-
"License :: OSI Approved :: CC BY 4.0 Attribution",
12+
"License :: Free To Use But Restricted",
1313
"Operating System :: OS Independent",
1414
]
1515
dependencies = [

0 commit comments

Comments
 (0)