Resolved bug with already existing remote (#230)
* Resolved bug with already existing remote * Added the --exit-code option * Added debug lines * Update entrypoint.sh * Update entrypoint.sh
This commit is contained in:
parent
227fb65ec9
commit
2b51570d5f
@ -17,14 +17,24 @@ fi
|
|||||||
|
|
||||||
SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}')
|
SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}')
|
||||||
|
|
||||||
git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}"
|
echo "Setting up 'temp_changed_files' remote..."
|
||||||
|
|
||||||
|
git ls-remote --exit-code temp_changed_files 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
|
if [[ $exit_status -ne 0 ]]; then
|
||||||
|
echo "No 'temp_changed_files' remote found"
|
||||||
|
echo "Creating 'temp_changed_files' remote..."
|
||||||
|
git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}"
|
||||||
|
else
|
||||||
|
echo "Found 'temp_changed_files' remote"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Getting HEAD info..."
|
echo "Getting HEAD info..."
|
||||||
|
|
||||||
if [[ -z $INPUT_SHA ]]; then
|
if [[ -z $INPUT_SHA ]]; then
|
||||||
CURRENT_SHA=$(git rev-parse HEAD 2>&1) && exit_status=$? || exit_status=$?
|
CURRENT_SHA=$(git rev-parse HEAD 2>&1) && exit_status=$? || exit_status=$?
|
||||||
else
|
else
|
||||||
CURRENT_SHA=$INPUT_SHA
|
CURRENT_SHA=$INPUT_SHA && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $exit_status -ne 0 ]]; then
|
if [[ $exit_status -ne 0 ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user