Skip to content

Instantly share code, notes, and snippets.

@datYori
Last active December 4, 2023 13:10
Show Gist options
  • Save datYori/2f1544b118962c5dd34c49735ebe14b1 to your computer and use it in GitHub Desktop.
Save datYori/2f1544b118962c5dd34c49735ebe14b1 to your computer and use it in GitHub Desktop.
trigger new gha workflow from non default branch
gh api -XPATCH "repos/raw-labs/$REPO_NAME" -f default_branch="$(git symbolic-ref --short HEAD)" > /dev/null && gh workflow run $WORKFLOW_FULL_NAME && gh api -XPATCH "repos/raw-labs/$REPO_NAME" -f default_branch="$REPO_DEFAULT_BRANCH" > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment