fix webhooks
This commit is contained in:
parent
2ee1ebbdc3
commit
510a49ec0e
1 changed files with 71 additions and 76 deletions
|
@ -112,82 +112,77 @@ Also make sure to replace your execute-command lines with ones referencing your
|
||||||
`/etc/webhook.conf`
|
`/etc/webhook.conf`
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "update-pages",
|
"id": "update-pages",
|
||||||
"execute-command": "su joshua /home/joshua/webhooks/update-pages.sh",
|
"execute-command": "/usr/bin/sudo",
|
||||||
"command-working-directory": "/var/www",
|
"pass-arguments-to-command":
|
||||||
"pass-arguments-to-command":
|
[
|
||||||
[
|
{ "source": "string", "name": "-u"},
|
||||||
{
|
{ "source": "string", "name": "joshua"},
|
||||||
"source": "payload",
|
{ "source": "string", "name": "/home/joshua/webhooks/update-pages.sh"},
|
||||||
"name": "repository.name"
|
{ "source": "payload", "name": "repository.name" },
|
||||||
},
|
{ "source": "payload", "name": "repository.clone_url" }
|
||||||
{
|
],
|
||||||
"source": "payload",
|
"trigger-rule":
|
||||||
"name": "repository.clone_url"
|
{
|
||||||
},
|
"and":
|
||||||
],
|
[
|
||||||
"trigger-rule":
|
{
|
||||||
{
|
"match":
|
||||||
"and":
|
{
|
||||||
[
|
"type": "payload-hmac-sha256",
|
||||||
{
|
"secret": "(omitted)",
|
||||||
"match":
|
"parameter":
|
||||||
{
|
{
|
||||||
"type": "payload-hmac-sha256",
|
"source": "header",
|
||||||
"secret": "(omitted)",
|
"name": "X-Forgejo-Signature"
|
||||||
"parameter":
|
}
|
||||||
{
|
}
|
||||||
"source": "header",
|
},
|
||||||
"name": "X-Forgejo-Signature"
|
{
|
||||||
}
|
"match":
|
||||||
}
|
{
|
||||||
},
|
"type": "value",
|
||||||
{
|
"value": "refs/heads/gh-pages",
|
||||||
"match":
|
"parameter":
|
||||||
{
|
{
|
||||||
"type": "value",
|
"source": "payload",
|
||||||
"value": "refs/heads/gh-pages",
|
"name": "ref"
|
||||||
"parameter":
|
}
|
||||||
{
|
}
|
||||||
"source": "payload",
|
}
|
||||||
"name": "ref"
|
]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
]
|
"id": "remove-pages",
|
||||||
}
|
"execute-command": "/usr/bin/sudo",
|
||||||
},
|
"pass-arguments-to-command":
|
||||||
{
|
[
|
||||||
"id": "remove-pages",
|
{ "source": "string", "name": "-u"},
|
||||||
"execute-command": "su joshua /home/joshua/webhooks/remove-pages.sh",
|
{ "source": "string", "name": "joshua"},
|
||||||
"command-working-directory": "/var/www",
|
{ "source": "string", "name": "/home/joshua/webhooks/remove-pages.sh"},
|
||||||
"pass-arguments-to-command":
|
{ "source": "payload", "name": "repository.name" }
|
||||||
[
|
],
|
||||||
{
|
"trigger-rule":
|
||||||
"source": "payload",
|
{
|
||||||
"name": "repository.name"
|
"and":
|
||||||
},
|
[
|
||||||
],
|
{
|
||||||
"trigger-rule":
|
"match":
|
||||||
{
|
{
|
||||||
"and":
|
"type": "payload-hmac-sha256",
|
||||||
[
|
"secret": "(omitted)",
|
||||||
{
|
"parameter":
|
||||||
"match":
|
{
|
||||||
{
|
"source": "header",
|
||||||
"type": "payload-hmac-sha256",
|
"name": "X-Forgejo-Signature"
|
||||||
"secret": "(omitted)",
|
}
|
||||||
"parameter":
|
}
|
||||||
{
|
}
|
||||||
"source": "header",
|
]
|
||||||
"name": "X-Forgejo-Signature"
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue