Skip to content

Commit

Permalink
Fix missing wildcard in os/arch/variant pattern match (#888)
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <sxa@redhat.com>
  • Loading branch information
sxa committed Jan 12, 2024
1 parent 96c80ef commit 0b73b13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -906,9 +906,9 @@ class Builder implements Serializable {
//Remove the previous artifacts
try {
context.timeout(time: pipelineTimeouts.REMOVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
if ( ! ( "${config.TARGET_OS}" ==~ /^[A-Za-z0-9\/\.-_]$/ ) ||
! ( "${config.ARCHITECTURE}" ==~ /^[A-Za-z0-9\/\.-_]$/ ) ||
! ( "${config.VARIANT}" ==~ /^[A-Za-z0-9\/\.-_]$/ ) ) {
if ( ! ( "${config.TARGET_OS}" ==~ /^[A-Za-z0-9\/\.-_]*$/ ) ||
! ( "${config.ARCHITECTURE}" ==~ /^[A-Za-z0-9\/\.-_]*$/ ) ||
! ( "${config.VARIANT}" ==~ /^[A-Za-z0-9\/\.-_]*$/ ) ) {
throw new Exception("[ERROR] Dubious character in TARGET_OS, ARCHITECTURE or VARIANT - aborting");
}
context.sh "rm -rf target/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}/"
Expand Down

0 comments on commit 0b73b13

Please sign in to comment.