-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathentrypoint
More file actions
executable file
·36 lines (29 loc) · 863 Bytes
/
Copy pathentrypoint
File metadata and controls
executable file
·36 lines (29 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
shopt -s nullglob
if [ -n "$INPUT_USER" ]; then
user_tmp="$INPUT_USER"
elif [ -n "$GITHUB_REPOSITORY" ]; then
user_tmp="${GITHUB_REPOSITORY%%/*}"
fi
user=${user_tmp?Please specify a user}
repository=${INPUT_REPOSITORY?Please specify a repository}
if [ -n "$INPUT_DIRECTORY" ]; then
echo + cd "$INPUT_DIRECTORY"
cd "$INPUT_DIRECTORY"
fi
# "files" array:
if [ -n "$INPUT_FILES" ]; then
IFS=' ' read -r -a files <<<"$INPUT_FILES"
else
# Use all debs and rpms under current directory
readarray -d '' files < <(find . -type f \( -name '*.deb' -o -name '*.rpm' \) -print0)
if [ "${#files[@]}" -eq 0 ]; then
# Ok, time to give up
echo No .deb nor .rpm files found >&2
exit 1
fi
fi
set -e -x -o pipefail
for file in "${files[@]}"; do
package_cloud push "${user}/$repository" "$file"
done