mirror of
				https://code.forgejo.org/actions/forgejo-release.git
				synced 2025-11-04 06:41:57 +02: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() {
 | 
			
		||||
    # 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=""
 | 
			
		||||
    for cmd in curl jq; do
 | 
			
		||||
    for cmd in $deps; do
 | 
			
		||||
        if ! command -v "$cmd" >/dev/null 2>&1; then
 | 
			
		||||
            missing="$missing $cmd"
 | 
			
		||||
        fi
 | 
			
		||||
| 
						 | 
				
			
			@ -165,6 +173,7 @@ maybe_use_release_note_assistant() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
sign_release() {
 | 
			
		||||
    check_dependencies gpg
 | 
			
		||||
    passphrase=""
 | 
			
		||||
    if [ -s "$GPG_PASSPHRASE" ]; then
 | 
			
		||||
        passphrase="--passphrase-file $GPG_PASSPHRASE"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue