1 Commits

Author SHA1 Message Date
Dwi Siswanto
73c272d7a5 Removes a constant value that will rewrite values of properties 2020-07-21 23:20:39 +07:00
2 changed files with 8 additions and 11 deletions

View File

@@ -12,13 +12,11 @@ LABEL maintainer="dwisiswant0"
RUN npm config set unsafe-perm true && \ RUN npm config set unsafe-perm true && \
npm install --silent --save-dev -g typescript@3.5.2 && \ npm install --silent --save-dev -g typescript@3.5.2 && \
npm config set unsafe-perm false && \ npm config set unsafe-perm false
apk add --no-cache ca-certificates jq
ENV NODE_PATH "/usr/lib/node_modules/" ENV NODE_PATH "/usr/lib/node_modules/"
RUN apk add --no-cache ca-certificates jq
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -6,16 +6,15 @@ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
EVENT_ACTION=$(jq -r ".action" "${GITHUB_EVENT_PATH}") EVENT_ACTION=$(jq -r ".action" "${GITHUB_EVENT_PATH}")
if [[ "${EVENT_ACTION}" != "opened" ]]; then if [[ "${EVENT_ACTION}" != "opened" ]]; then
echo "No need to run analysis. It is already triggered by the push event." echo "No need to run analysis. It is already triggered by the push event."
exit exit 78
fi fi
fi fi
REPOSITORY_NAME=$(basename "${GITHUB_REPOSITORY}")
[[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD="" [[ ! -z ${INPUT_PASSWORD} ]] && SONAR_PASSWORD="${INPUT_PASSWORD}" || SONAR_PASSWORD=""
[[ -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${REPOSITORY_NAME}" || SONAR_PROJECTKEY="${INPUT_PROJECTKEY}" [[ ! -z ${INPUT_PROJECTKEY} ]] && SONAR_PROJECTKEY="${INPUT_PROJECTKEY}" || SONAR_PROJECTKEY=""
[[ -z ${INPUT_PROJECTNAME} ]] && SONAR_PROJECTNAME="${REPOSITORY_NAME}" || SONAR_PROJECTNAME="${INPUT_PROJECTNAME}" [[ ! -z ${INPUT_PROJECTNAME} ]] && SONAR_PROJECTNAME="${INPUT_PROJECTNAME}" || SONAR_PROJECTNAME=""
[[ -z ${INPUT_PROJECTVERSION} ]] && SONAR_PROJECTVERSION="" || SONAR_PROJECTVERSION="${INPUT_PROJECTVERSION}" [[ ! -z ${INPUT_PROJECTVERSION} ]] && SONAR_PROJECTVERSION="${INPUT_PROJECTVERSION}" || SONAR_PROJECTVERSION=""
sonar-scanner \ sonar-scanner \
-Dsonar.host.url=${INPUT_HOST} \ -Dsonar.host.url=${INPUT_HOST} \