Support repository dispatch based on ESP-IDF tag

This commit is contained in:
me-no-dev 2023-04-11 15:59:44 +03:00
parent e19b5023c1
commit 06503deef4

View file

@ -9,11 +9,12 @@ EVENT_JSON=`cat "$GITHUB_EVENT_PATH"`
action=`echo "$EVENT_JSON" | jq -r '.action'` action=`echo "$EVENT_JSON" | jq -r '.action'`
payload=`echo "$EVENT_JSON" | jq -r '.client_payload'` payload=`echo "$EVENT_JSON" | jq -r '.client_payload'`
branch=`echo "$payload" | jq -r '.branch'` branch=`echo "$payload" | jq -r '.branch'`
tag=`echo "$payload" | jq -r '.tag'`
commit=`echo "$payload" | jq -r '.commit'` commit=`echo "$payload" | jq -r '.commit'`
builder=`echo "$payload" | jq -r '.builder'` builder=`echo "$payload" | jq -r '.builder'`
arduino=`echo "$payload" | jq -r '.arduino'` arduino=`echo "$payload" | jq -r '.arduino'`
echo "Action: $action, Branch: $branch, Commit: $commit, Builder: $builder" echo "Action: $action, Branch: $branch, Tag: $tag, Commit: $commit, Builder: $builder, Arduino: $arduino"
if [ ! "$action" == "deploy" ] && [ ! "$action" == "build" ]; then if [ ! "$action" == "deploy" ] && [ ! "$action" == "build" ]; then
echo "Bad Action $action" echo "Bad Action $action"
@ -26,6 +27,8 @@ if [ ! "$commit" == "" ] && [ ! "$commit" == "null" ]; then
export IDF_COMMIT="$commit" export IDF_COMMIT="$commit"
else else
commit="" commit=""
if [ ! "$tag" == "" ] && [ ! "$tag" == "null" ]; then
export IDF_TAG="$tag"
if [ ! "$branch" == "" ] && [ ! "$branch" == "null" ]; then if [ ! "$branch" == "" ] && [ ! "$branch" == "null" ]; then
export IDF_BRANCH="$branch" export IDF_BRANCH="$branch"
fi fi