mirror of
https://github.com/SonarSource/sonarqube-scan-action.git
synced 2025-12-15 18:46:31 +00:00
fix: use post-entrypoint script to run cleanup tasks
This commit is contained in:
parent
bdba66714e
commit
b83926d45e
4 changed files with 12 additions and 4 deletions
|
|
@ -12,4 +12,6 @@ LABEL version="1.1.0" \
|
|||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
COPY cleanup.sh /cleanup.sh
|
||||
RUN chmod +x /cleanup.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ branding:
|
|||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
entrypoint: "/entrypoint.sh"
|
||||
post-entrypoint: "/cleanup.sh"
|
||||
inputs:
|
||||
args:
|
||||
description: Additional arguments to the sonar-scanner
|
||||
|
|
|
|||
8
cleanup.sh
Executable file
8
cleanup.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
_tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1)
|
||||
PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file")
|
||||
|
||||
chown -R $PERM "${INPUT_PROJECTBASEDIR}/"
|
||||
|
|
@ -27,7 +27,3 @@ unset JAVA_HOME
|
|||
|
||||
sonar-scanner -Dsonar.projectBaseDir=${INPUT_PROJECTBASEDIR} ${INPUT_ARGS}
|
||||
|
||||
_tmp_file=$(ls "${INPUT_PROJECTBASEDIR}/" | head -1)
|
||||
PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR}/$_tmp_file")
|
||||
|
||||
chown -R $PERM "${INPUT_PROJECTBASEDIR}/"
|
||||
|
|
|
|||
Loading…
Reference in a new issue