mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 16:16:09 -07:00
set options to make it easier to debug if a command fails
Make use of optional arguments on action.yml in order to avoid testing against an undefined variable
This commit is contained in:
parent
884b652fa7
commit
da21c6b08d
|
@ -16,8 +16,10 @@ inputs:
|
||||||
destination-repository-username:
|
destination-repository-username:
|
||||||
description: '[Optional] Username/organization for the destination repository'
|
description: '[Optional] Username/organization for the destination repository'
|
||||||
required: false
|
required: false
|
||||||
|
default: ''
|
||||||
target-branch:
|
target-branch:
|
||||||
description: '[Optional] set target branch name for the destination repository'
|
description: '[Optional] set target branch name for the destination repository. Defaults to "master"'
|
||||||
|
default: 'master'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set -e # if a command fails it stops the execution
|
||||||
|
set -u # script fails if trying to access to an undefined variable
|
||||||
|
|
||||||
echo "Starts"
|
echo "Starts"
|
||||||
FOLDER="$1"
|
FOLDER="$1"
|
||||||
GITHUB_USERNAME="$2"
|
GITHUB_USERNAME="$2"
|
||||||
|
@ -12,10 +17,6 @@ if [ -z "$REPO_USERNAME" ]
|
||||||
then
|
then
|
||||||
REPO_USERNAME="$GITHUB_USERNAME"
|
REPO_USERNAME="$GITHUB_USERNAME"
|
||||||
fi
|
fi
|
||||||
if [ -z "$TARGET_BRANCH" ]
|
|
||||||
then
|
|
||||||
TARGET_BRANCH="master"
|
|
||||||
fi
|
|
||||||
|
|
||||||
CLONE_DIR=$(mktemp -d)
|
CLONE_DIR=$(mktemp -d)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user