diff --git a/plugins/github/github-deploy.mk b/plugins/github/github-deploy.mk index 76fb8a5..2f98a00 100644 --- a/plugins/github/github-deploy.mk +++ b/plugins/github/github-deploy.mk @@ -8,6 +8,7 @@ # $(call, some-env) <- deploy is the default task # $(call, some-env, some-task) AUTO_MERGE=true +GITHUB_DEPLOY_PAYLOAD="{}" 1:= 2:= define deploy @@ -15,5 +16,6 @@ define deploy $(dir $(abspath $(lastword $(filter %.mk, $(MAKEFILE_LIST)))))github-deploy.sh \ $(strip $1) \ ${AUTO_MERGE} \ - $(strip $(if $2, $2, deploy)) + $(strip $(if $2, $2, deploy)) \ + ${GITHUB_DEPLOY_PAYLOAD} endef diff --git a/plugins/github/github-deploy.sh b/plugins/github/github-deploy.sh index 26382e5..11051d9 100755 --- a/plugins/github/github-deploy.sh +++ b/plugins/github/github-deploy.sh @@ -5,12 +5,13 @@ set -eu -o pipefail environment=$1 auto_merge=$2 task=$3 +payload=$4 if git fetch && git diff @"{push}" --shortstat --exit-code >/dev/null 2>&1; then # Trigger the deployment event gh api repos/:owner/:repo/deployments -H "Accept: application/vnd.github.ant-man-preview+json" \ --method POST -F ref=":branch" -F environment="$environment" -F auto_merge="$auto_merge" \ - -F task="$task" + -F task="$task" -F payload="$payload" echo "Looking for active runs..." && sleep 5