mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-08-07 18:23:30 +00:00
Add validation and complete PPA repository support implementation
Co-authored-by: awalsh128 <2087466+awalsh128@users.noreply.github.com>
This commit is contained in:
parent
8a6446804a
commit
65ea819d3b
0
apt_query-x86.log
Normal file
0
apt_query-x86.log
Normal file
|
|
@ -65,6 +65,21 @@ fi
|
||||||
|
|
||||||
validate_bool "${execute_install_scripts}" execute_install_scripts 4
|
validate_bool "${execute_install_scripts}" execute_install_scripts 4
|
||||||
|
|
||||||
|
# Basic validation for repository parameter
|
||||||
|
if [ -n "${add_repository}" ]; then
|
||||||
|
log "Validating repository parameter..."
|
||||||
|
for repository in ${add_repository}; do
|
||||||
|
# Check if repository format looks valid (basic check)
|
||||||
|
if [[ "${repository}" =~ [^a-zA-Z0-9:\/.-] ]]; then
|
||||||
|
log "aborted"
|
||||||
|
log "Repository '${repository}' contains invalid characters." >&2
|
||||||
|
log "Supported formats: 'ppa:user/repo', 'deb http://...', 'http://...', 'multiverse', etc." >&2
|
||||||
|
exit 6
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
log "done"
|
||||||
|
fi
|
||||||
|
|
||||||
log "done"
|
log "done"
|
||||||
|
|
||||||
log_empty_line
|
log_empty_line
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue