Skip to content

Commit 78e43d6

Browse files
committed
Add support for custom local branch names
1 parent 80e09b6 commit 78e43d6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ action "Git Push to Production" {
3737
| Name | Type | Usage |
3838
|-|-|-|
3939
| `WPENGINE_ENVIRONMENT` | Environment Variable | Defaults to `production`. You shouldn't need to change this, but if you're using WP Engine's legacy staging, you can override the default and set to `staging` if needed. |
40+
| `LOCAL_BRANCH` | Environment Variable | Set which branch in your repository you'd like to push to WP Engine. Defaults to `master`. |
4041

4142
### Further reading
4243

entrypoint.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ WPENGINE_SSH_KEY_PRIVATE_PATH="$SSH_PATH/wpengine_key"
1313
WPENGINE_SSH_KEY_PUBLIC_PATH="$SSH_PATH/wpengine_key.pub"
1414
WPENGINE_ENVIRONMENT_DEFAULT="production"
1515
WPENGINE_ENV=${WPENGINE_ENVIRONMENT:-$WPENGINE_ENVIRONMENT_DEFAULT}
16+
LOCAL_BRANCH_DEFAULT="master"
17+
BRANCH=${LOCAL_BRANCH:-$LOCAL_BRANCH_DEFAULT}
1618

1719
mkdir "$SSH_PATH"
1820

@@ -28,4 +30,4 @@ chmod 644 "$WPENGINE_SSH_KEY_PUBLIC_PATH"
2830

2931
git config core.sshCommand "ssh -i $WPENGINE_SSH_KEY_PRIVATE_PATH -o UserKnownHostsFile=$KNOWN_HOSTS_PATH"
3032
git remote add $WPENGINE_ENV git@$WPENGINE_HOST:$WPENGINE_ENV/$WPENGINE_ENVIRONMENT_NAME.git
31-
git push -fu $WPENGINE_ENV master
33+
git push -fu $WPENGINE_ENV $BRANCH:master

0 commit comments

Comments
 (0)