-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathentrypoint.sh
executable file
·71 lines (57 loc) · 1.46 KB
/
entrypoint.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
set -e
FLAGS="$SEMVER_RAW_FLAGS"
if [[ -z "$INPUT_CONFIG_FILE" ]]; then
echo "Set the configuration file path."
exit 1
else
FLAGS="${FLAGS} -c $INPUT_CONFIG_FILE"
fi
if [[ -z "$INPUT_REPOSITORY_URL" ]] && [[ -z "$INPUT_REPOSITORY_LOCAL" ]];
then
echo "You need to set either remote repository or repository local flags."
fi
if [[ ! -z "$INPUT_REPOSITORY_URL" ]]; then
FLAGS="${FLAGS} -r $INPUT_REPOSITORY_URL"
fi
if [[ ! -z "$INPUT_REPOSITORY_BRANCH" ]]; then
FLAGS="${FLAGS} -b $INPUT_REPOSITORY_BRANCH"
fi
if [[ ! -z "$INPUT_REPOSITORY_LOCAL" ]]; then
FLAGS="${FLAGS} -l"
fi
if [[ ! -z "$INPUT_STRICT" ]]; then
FLAGS="${FLAGS} -s"
fi
if [[ ! -z "$INPUT_EXISTING" ]]; then
FLAGS="${FLAGS} -e"
fi
if [[ ! -z "$INPUT_DEBUGMODE" ]]; then
FLAGS="${FLAGS} --debug"
fi
if [[ "${FLAGS}" == "" && "$*" == "" ]]; then
exit 1
fi
if [[ ! -z "$INPUT_GITHUB_TOKEN" ]]; then
export GITHUB_TOKEN=$INPUT_GITHUB_TOKEN
fi
if [[ ! -z "$INPUT_GITHUB_USERNAME" ]]; then
export GITHUB_USERNAME=$INPUT_GITHUB_USERNAME
fi
if [[ ! -z "$INPUT_DEBUGMODE" ]]; then
echo "DEBUG MODE ENABLED"
echo "----"
ls -lA
echo "----"
pwd
echo "----"
echo "FLAGS: $FLAGS"
echo "----"
/go/src/app/semver-gen generate $FLAGS $*
echo "----"
fi
OUT_SEMVER_GEN=$(/go/src/app/semver-gen generate $FLAGS $*)
[ $? -eq 0 ] || exit 1
CLEAN_SEMVER=$(echo $OUT_SEMVER_GEN | sed -e 's|SEMVER ||g')
echo "semantic_version=$CLEAN_SEMVER" >> $GITHUB_OUTPUT
echo $OUT_SEMVER_GEN