chore(ci): Add downstream merge trigger to github action (#3014)
This commit is contained in:
1 parent
18b0bcb395
commit
39e1cd7dcf
2 files changed
+63
No files matched your search
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BRANCH=${1}
|
||||
|
||||
if [[ -z "${BRANCH}" ]]; then
|
||||
echo "skipping no branch specified"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z "${DOWNSTREAM_SLUG}" ]]; then
|
||||
echo "skipping, no downstream"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z ${DOWNSTREAM_TOK} ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z ${DOWNSTREAM_WORKFLOW} ]]; then
|
||||
echo "skipping, no downstream workflow"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl \
|
||||
--silent \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${DOWNSTREAM_TOK}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"https://api.github.com/repos/hashicorp/boundary-${DOWNSTREAM_SLUG}/actions/workflows/${DOWNSTREAM_WORKFLOW}/dispatches" \
|
||||
-d @- << EOF
|
||||
{
|
||||
"ref": "${BRANCH}",
|
||||
"inputs": {
|
||||
"from-branch": "${BRANCH}",
|
||||
"to-branch": "${BRANCH}"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
Reference in new issue
Block a user