Last active
December 19, 2022 09:00
-
-
Save datYori/2d040ca693d8bb994ae1704c699c9af5 to your computer and use it in GitHub Desktop.
switch default and run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export INITIAL_DEFAULT_BRANCH=${INITIAL_DEFAULT_BRANCH:-master} | |
export WORKFLOW_YAML=<workflow_yaml> | |
export ORG_REPO=<repo> # example : export REPO="raw-labs/raw" | |
gh api -XPATCH "${ORG_REPO}" -f default_branch="$(git symbolic-ref --short HEAD)" > dev/null \ | |
&& gh workflow run ${WORKFLOW_YAML} \ | |
&& gh api -XPATCH "${ORG_REPO}" -f default_branch="${INITIAL_DEFAULT_BRANCH}" > dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment