mirror of
https://github.com/rancher/rke.git
synced 2025-06-24 14:31:59 +00:00
26 lines
772 B
Plaintext
26 lines
772 B
Plaintext
|
#!/bin/bash
|
||
|
set -e
|
||
|
set -x
|
||
|
|
||
|
REPO="https://api.github.com/repos/rancher/rancher/actions/workflows/go-get.yml/dispatches"
|
||
|
|
||
|
case $DRONE_TAG in
|
||
|
"v1.3"*)
|
||
|
ACTION_TARGET_BRANCH="release/v2.6"
|
||
|
;;
|
||
|
*)
|
||
|
echo "Not a valid tag, not dispatching event"
|
||
|
exit 0
|
||
|
esac
|
||
|
|
||
|
echo "DRONE_TAG: $DRONE_TAG"
|
||
|
echo "DRONE_COMMIT_AUTHOR: $DRONE_COMMIT_AUTHOR"
|
||
|
|
||
|
echo "Dispatching to branch ${ACTION_TARGET_BRANCH}"
|
||
|
|
||
|
# send dispatch event to workflow
|
||
|
curl -XPOST -u "${PAT_USERNAME}:${PAT_TOKEN}" \
|
||
|
-H "Accept: application/vnd.github.v3+json" \
|
||
|
-H "Content-Type: application/json" $REPO \
|
||
|
--data '{"ref": "'"$ACTION_TARGET_BRANCH"'","inputs":{"goget_module":"github.com/rancher/rke","goget_version":"'"$DRONE_TAG"'","source_author":"'"$DRONE_COMMIT_AUTHOR"'"}}'
|