mirror of
https://github.com/SonarSource/sonarqube-scan-action.git
synced 2025-12-12 17:31:15 +00:00
13 lines
566 B
Bash
Executable file
13 lines
566 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Reset all files permissions to the default Runner user and group to allow the follow up steps (mainly cache) to access all files.
|
|
|
|
# Assume that the first (non-hidden) file in the project directory is one from the project, and not one written by the scanner
|
|
_tmp_file=$(ls "${INPUT_PROJECTBASEDIR%/}/" | head -1)
|
|
echo "Reading permissions from $_tmp_file"
|
|
PERM=$(stat -c "%u:%g" "${INPUT_PROJECTBASEDIR%/}/$_tmp_file")
|
|
|
|
echo "Applying permissions $PERM to all files in the project base directory"
|
|
chown -R "$PERM" "${INPUT_PROJECTBASEDIR%/}/"
|