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'
|
name: 'Push directory to another repository directory'
|
||||||
description: 'Useful to push files to another repository to be used, for example, via github pages'
|
description: 'Useful to push files to another repository to be used, for example, via github pages'
|
||||||
inputs:
|
inputs:
|
||||||
|
source-before-directory:
|
||||||
|
description: 'Source before directory from the origin directory'
|
||||||
|
required: false
|
||||||
source-directory:
|
source-directory:
|
||||||
description: 'Source directory from the origin directory'
|
description: 'Source directory from the origin directory'
|
||||||
required: true
|
required: true
|
||||||
|
@ -37,6 +40,7 @@ runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
args:
|
args:
|
||||||
|
- ${{ inputs.source-before-directory }}
|
||||||
- ${{ inputs.source-directory }}
|
- ${{ inputs.source-directory }}
|
||||||
- ${{ inputs.destination-github-username }}
|
- ${{ inputs.destination-github-username }}
|
||||||
- ${{ inputs.destination-repository-name }}
|
- ${{ 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
|
set -u # script fails if trying to access to an undefined variable
|
||||||
|
|
||||||
echo "[+] Action start"
|
echo "[+] Action start"
|
||||||
SOURCE_DIRECTORY="$1"
|
SOURCE_BEFORE_DIRECTORY="$1"
|
||||||
DESTINATION_GITHUB_USERNAME="$2"
|
SOURCE_DIRECTORY="$2"
|
||||||
DESTINATION_REPOSITORY_NAME="$3"
|
DESTINATION_GITHUB_USERNAME="$3"
|
||||||
USER_EMAIL="$4"
|
DESTINATION_REPOSITORY_NAME="$4"
|
||||||
USER_NAME="$5"
|
USER_EMAIL="$5"
|
||||||
DESTINATION_REPOSITORY_USERNAME="$6"
|
USER_NAME="$6"
|
||||||
TARGET_BRANCH="$7"
|
DESTINATION_REPOSITORY_USERNAME="$7"
|
||||||
COMMIT_MESSAGE="$8"
|
TARGET_BRANCH="$8"
|
||||||
TARGET_DIRECTORY="$9"
|
COMMIT_MESSAGE="$9"
|
||||||
|
TARGET_DIRECTORY="$10"
|
||||||
|
|
||||||
if [ -z "$DESTINATION_REPOSITORY_USERNAME" ]
|
if [ -z "$DESTINATION_REPOSITORY_USERNAME" ]
|
||||||
then
|
then
|
||||||
|
@ -51,6 +52,10 @@ mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY"
|
||||||
|
|
||||||
mv "$TEMP_DIR/.git" "$CLONE_DIR/.git"
|
mv "$TEMP_DIR/.git" "$CLONE_DIR/.git"
|
||||||
|
|
||||||
|
|
||||||
|
echo "[+] Changing to $SOURCE_BEFORE_DIRECTORY"
|
||||||
|
cd $SOURCE_BEFORE_DIRECTORY
|
||||||
|
|
||||||
if [ ! -d "$SOURCE_DIRECTORY" ]
|
if [ ! -d "$SOURCE_DIRECTORY" ]
|
||||||
then
|
then
|
||||||
echo "ERROR: $SOURCE_DIRECTORY does not exist"
|
echo "ERROR: $SOURCE_DIRECTORY does not exist"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user