24 lines
679 B
Text
24 lines
679 B
Text
# Use gh as a credential helper
|
|
exec gh auth setup-git
|
|
|
|
# Create a repository with a file so it has a default branch
|
|
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
|
|
|
|
# Defer repo cleanup
|
|
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
|
|
|
|
# Clone the repo
|
|
exec gh repo clone $ORG/$SCRIPT_NAME-$RANDOM_STRING
|
|
|
|
# Prepare a branch to PR
|
|
cd $SCRIPT_NAME-$RANDOM_STRING
|
|
exec git checkout -b feature-branch
|
|
exec git commit --allow-empty -m 'Empty Commit'
|
|
exec git push -u origin feature-branch
|
|
|
|
# Create the PR
|
|
exec gh pr create --title 'Feature Title' --body 'Feature Body'
|
|
|
|
# Check the PR is indeed created
|
|
exec gh pr view
|
|
stdout 'Feature Title'
|