2022-05-31 11:07:03 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2024-03-29 18:56:51 +03:00
|
|
|
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
|
2024-04-30 13:16:39 +03:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
|
2022-05-31 11:07:03 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
## This file is intended to be sourced by other scripts
|
|
|
|
|
|
|
|
|
|
|
|
function err() {
|
|
|
|
echo >&2 "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function curl_gh() {
|
|
|
|
if [[ -n "$GITHUB_TOKEN" ]]
|
|
|
|
then
|
|
|
|
curl \
|
|
|
|
--silent \
|
|
|
|
--header "Authorization: token $GITHUB_TOKEN" \
|
|
|
|
"$@"
|
|
|
|
else
|
|
|
|
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|