mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 08:06:10 -07:00
Add some fixes
This commit is contained in:
parent
b4480ee4f3
commit
7a8c60c186
|
@ -1,6 +1,9 @@
|
|||
name: 'Push directory to another repository directory'
|
||||
description: 'Useful to push files to another repository to be used, for example, via github pages'
|
||||
inputs:
|
||||
source-before-directory:
|
||||
description: 'Source before directory from the origin directory'
|
||||
required: false
|
||||
source-directory:
|
||||
description: 'Source directory from the origin directory'
|
||||
required: true
|
||||
|
@ -37,6 +40,7 @@ runs:
|
|||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.source-before-directory }}
|
||||
- ${{ inputs.source-directory }}
|
||||
- ${{ inputs.destination-github-username }}
|
||||
- ${{ inputs.destination-repository-name }}
|
||||
|
|
|
@ -4,15 +4,16 @@ set -e # if a command fails it stops the execution
|
|||
set -u # script fails if trying to access to an undefined variable
|
||||
|
||||
echo "[+] Action start"
|
||||
SOURCE_DIRECTORY="$1"
|
||||
DESTINATION_GITHUB_USERNAME="$2"
|
||||
DESTINATION_REPOSITORY_NAME="$3"
|
||||
USER_EMAIL="$4"
|
||||
USER_NAME="$5"
|
||||
DESTINATION_REPOSITORY_USERNAME="$6"
|
||||
TARGET_BRANCH="$7"
|
||||
COMMIT_MESSAGE="$8"
|
||||
TARGET_DIRECTORY="$9"
|
||||
SOURCE_BEFORE_DIRECTORY="$1"
|
||||
SOURCE_DIRECTORY="$2"
|
||||
DESTINATION_GITHUB_USERNAME="$3"
|
||||
DESTINATION_REPOSITORY_NAME="$4"
|
||||
USER_EMAIL="$5"
|
||||
USER_NAME="$6"
|
||||
DESTINATION_REPOSITORY_USERNAME="$7"
|
||||
TARGET_BRANCH="$8"
|
||||
COMMIT_MESSAGE="$9"
|
||||
TARGET_DIRECTORY="$10"
|
||||
|
||||
if [ -z "$DESTINATION_REPOSITORY_USERNAME" ]
|
||||
then
|
||||
|
@ -51,6 +52,10 @@ mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY"
|
|||
|
||||
mv "$TEMP_DIR/.git" "$CLONE_DIR/.git"
|
||||
|
||||
|
||||
echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY"
|
||||
cd $SOURCE_BEFORE_DIRECTORY
|
||||
|
||||
if [ ! -d "$SOURCE_DIRECTORY" ]
|
||||
then
|
||||
echo "ERROR: $SOURCE_DIRECTORY does not exist"
|
||||
|
|
Loading…
Reference in New Issue
Block a user