mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-10-13 16:11:56 +03:00
forgejo-release.sh: Allow arguments to be checked in check_dependencies
This allows us to pass in extra dependencies in testing scenarios. In this case sign_release requires gpg to run.
This commit is contained in:
parent
8cfa95b448
commit
fc4e870d23
1 changed files with 10 additions and 1 deletions
|
@ -43,8 +43,16 @@ get_arch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
check_dependencies() {
|
check_dependencies() {
|
||||||
|
# Always required for API parsing and downloads
|
||||||
|
deps="curl jq"
|
||||||
|
|
||||||
|
# Append any extra arguments to the list of dependencies to check
|
||||||
|
if [ "$#" -gt 0 ]; then
|
||||||
|
deps="$deps $*"
|
||||||
|
fi
|
||||||
|
|
||||||
missing=""
|
missing=""
|
||||||
for cmd in curl jq; do
|
for cmd in $deps; do
|
||||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||||
missing="$missing $cmd"
|
missing="$missing $cmd"
|
||||||
fi
|
fi
|
||||||
|
@ -165,6 +173,7 @@ maybe_use_release_note_assistant() {
|
||||||
}
|
}
|
||||||
|
|
||||||
sign_release() {
|
sign_release() {
|
||||||
|
check_dependencies gpg
|
||||||
passphrase=""
|
passphrase=""
|
||||||
if [ -s "$GPG_PASSPHRASE" ]; then
|
if [ -s "$GPG_PASSPHRASE" ]; then
|
||||||
passphrase="--passphrase-file $GPG_PASSPHRASE"
|
passphrase="--passphrase-file $GPG_PASSPHRASE"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue