mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2025-09-05 08:05:47 -06:00
parent
e775fb8544
commit
96f65f4ae1
@ -48,6 +48,10 @@ inputs:
|
|||||||
description: '[Optional] The directory to wipe and replace in the target repository'
|
description: '[Optional] The directory to wipe and replace in the target repository'
|
||||||
default: ''
|
default: ''
|
||||||
required: false
|
required: false
|
||||||
|
target-directory-ignored-file-name:
|
||||||
|
description: '[Optional] A file name within the target directory that is not deleted'
|
||||||
|
default: ''
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: docker
|
using: docker
|
||||||
|
@ -15,6 +15,7 @@ DESTINATION_REPOSITORY_USERNAME="${8}"
|
|||||||
TARGET_BRANCH="${9}"
|
TARGET_BRANCH="${9}"
|
||||||
COMMIT_MESSAGE="${10}"
|
COMMIT_MESSAGE="${10}"
|
||||||
TARGET_DIRECTORY="${11}"
|
TARGET_DIRECTORY="${11}"
|
||||||
|
TARGET_DIRECTORY_IGNORED_FILE_NAME="${12}"
|
||||||
|
|
||||||
if [ -z "$DESTINATION_REPOSITORY_USERNAME" ]
|
if [ -z "$DESTINATION_REPOSITORY_USERNAME" ]
|
||||||
then
|
then
|
||||||
@ -87,7 +88,10 @@ mv "$CLONE_DIR/.git" "$TEMP_DIR/.git"
|
|||||||
ABSOLUTE_TARGET_DIRECTORY="$CLONE_DIR/$TARGET_DIRECTORY/"
|
ABSOLUTE_TARGET_DIRECTORY="$CLONE_DIR/$TARGET_DIRECTORY/"
|
||||||
|
|
||||||
echo "[+] Deleting $ABSOLUTE_TARGET_DIRECTORY"
|
echo "[+] Deleting $ABSOLUTE_TARGET_DIRECTORY"
|
||||||
rm -rf "$ABSOLUTE_TARGET_DIRECTORY"
|
$CURRENT_DIR="$(pwd)"
|
||||||
|
cd $ABSOLUTE_TARGET_DIRECTORY
|
||||||
|
ls | grep -v $TARGET_DIRECTORY_IGNORED_FILE_NAME | xargs rm -fr
|
||||||
|
cd $CURRENT_DIR
|
||||||
|
|
||||||
echo "[+] Creating (now empty) $ABSOLUTE_TARGET_DIRECTORY"
|
echo "[+] Creating (now empty) $ABSOLUTE_TARGET_DIRECTORY"
|
||||||
mkdir -p "$ABSOLUTE_TARGET_DIRECTORY"
|
mkdir -p "$ABSOLUTE_TARGET_DIRECTORY"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user