forked from open-quantum-safe/liboqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider-test-trigger.sh
executable file
·38 lines (32 loc) · 1.3 KB
/
provider-test-trigger.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# SPDX-License-Identifier: MIT
# Trigger the oqs-provider release tests in CI.
# Variables:
# ACCESS_TOKEN: a GitHub Personal Access Token with repo and workflow permissions. Required.
# LIBOQS_REF: the liboqs branch or tag on which to run. Defaults to "main" if not specified.
# PROVIDER_REF: the oqs-provider branch or tag on which to run. Defaults to "main" if not specified.
# CURL_FLAGS: additional flags (e.g., "--silent") to pass to the curl command
if [ -z $ACCESS_TOKEN ]; then
echo "This script requires a GitHub Personal Access Token with repo and workflow permissions."
exit 1
fi
# default to running on liboqs main / provider main
if [ -z $LIBOQS_REF ]; then
export LIBOQS_REF="main"
fi
if [ -z $PROVIDER_REF ]; then
export PROVIDER_REF="main"
fi
curl $CURL_FLAGS \
--request POST \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
--data "{
\"event_type\": \"liboqs-release\",
\"client_payload\": {
\"liboqs_ref\": \"$LIBOQS_REF\",
\"provider_ref\": \"$PROVIDER_REF\"
}
}" \
https://api.github.com/repos/open-quantum-safe/oqs-provider/dispatches