mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-11 16:14:52 +00:00
Merge 5d0285372c
into 1b13355196
This commit is contained in:
commit
529017c56c
1 changed files with 70 additions and 0 deletions
|
@ -22,6 +22,7 @@ although the examples on this page all use the JSON format.
|
|||
* [Multipart Form Data](#multipart-form-data)
|
||||
* [Pass string arguments to command](#pass-string-arguments-to-command)
|
||||
* [Receive Synology DSM notifications](#receive-synology-notifications)
|
||||
* [Incoming Azure Container Registry (ACR) webhook](#incoming-acr-webhook)
|
||||
|
||||
## Incoming Github webhook
|
||||
|
||||
|
@ -673,3 +674,72 @@ Webhooks feature introduced in DSM 7.x seems to be incomplete & broken, but you
|
|||
}
|
||||
]
|
||||
```
|
||||
## Incoming Azure Container Registry (ACR) webhook
|
||||
|
||||
ACR can send webhooks on image push events. The `hooks.json` below will handle those events and pass relevant properties as environment variables to a command.
|
||||
|
||||
Here is an example of a working docker webhook container used to handle the webhooks and fill the cache of a local registry: [ACR Harbor local cache feeder](https://github.com/tomdess/registry-cache-feeder).
|
||||
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "acr-push-event",
|
||||
"execute-command": "/config/script-acr.sh",
|
||||
"command-working-directory": "/config",
|
||||
"pass-environment-to-command":
|
||||
[
|
||||
{
|
||||
"envname": "ACTION",
|
||||
"source": "payload",
|
||||
"name": "action"
|
||||
},
|
||||
{
|
||||
"envname": "REPO",
|
||||
"source": "payload",
|
||||
"name": "target.repository"
|
||||
},
|
||||
{
|
||||
"envname": "TAG",
|
||||
"source": "payload",
|
||||
"name": "target.tag"
|
||||
},
|
||||
{
|
||||
"envname": "DIGEST",
|
||||
"source": "payload",
|
||||
"name": "target.digest"
|
||||
}
|
||||
],
|
||||
"trigger-rule":
|
||||
{
|
||||
"and":
|
||||
[
|
||||
{
|
||||
"match":
|
||||
{
|
||||
"type": "value",
|
||||
"value": "mysecretToken",
|
||||
"parameter":
|
||||
{
|
||||
"source": "header",
|
||||
"name": "X-Static-Token"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match":
|
||||
{
|
||||
"type": "value",
|
||||
"value": "push",
|
||||
"parameter":
|
||||
{
|
||||
"source": "payload",
|
||||
"name": "action"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue