-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merges changes from @williammartin including acceptance tests and word changes. Co-authored-by: William Martin <[email protected]>
- Loading branch information
1 parent
88b96f4
commit 5da86e0
Showing
5 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
acceptance/testdata/pr/pr-create-from-issue-develop-base.txtar
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Set up env vars | ||
env REPO=${SCRIPT_NAME}-${RANDOM_STRING} | ||
|
||
# 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}/${REPO} --add-readme --private | ||
|
||
# Defer repo cleanup | ||
defer gh repo delete --yes ${ORG}/${REPO} | ||
|
||
# Clone the repo | ||
exec gh repo clone ${ORG}/${REPO} | ||
|
||
# Create a branch to act as the merge base branch | ||
cd ${REPO} | ||
exec git checkout -b long-lived-feature-branch | ||
exec git push -u origin long-lived-feature-branch | ||
|
||
# Create an issue to develop against | ||
exec gh issue create --title 'Feature Request' --body 'Request Body' | ||
stdout2env ISSUE_URL | ||
|
||
# Create a new branch using issue develop with the long lived branch as the base | ||
exec gh issue develop --name 'feature-branch' --base 'long-lived-feature-branch' --checkout ${ISSUE_URL} | ||
|
||
# Prepare a PR on the develop 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 created against the base branch we specified | ||
exec gh pr view --json 'baseRefName' --jq '.baseRefName' | ||
stdout 'long-lived-feature-branch' |
34 changes: 34 additions & 0 deletions
34
acceptance/testdata/pr/pr-create-from-manual-merge-base.txtar
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Set up env vars | ||
env REPO=${SCRIPT_NAME}-${RANDOM_STRING} | ||
|
||
# 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}/${REPO} --add-readme --private | ||
|
||
# Defer repo cleanup | ||
defer gh repo delete --yes ${ORG}/${REPO} | ||
|
||
# Clone the repo | ||
exec gh repo clone ${ORG}/${REPO} | ||
|
||
# Create a branch to act as the merge base branch | ||
cd ${REPO} | ||
exec git checkout -b long-lived-feature-branch | ||
exec git push -u origin long-lived-feature-branch | ||
|
||
# Prepare a branch from the merge base to PR | ||
exec git checkout -b feature-branch | ||
exec git commit --allow-empty -m 'Empty Commit' | ||
exec git push -u origin feature-branch | ||
|
||
# Set the merge-base branch config | ||
exec git config 'branch.feature-branch.gh-merge-base' 'long-lived-feature-branch' | ||
|
||
# Create the PR | ||
exec gh pr create --title 'Feature Title' --body 'Feature Body' | ||
|
||
# Check the PR is created against the merge base branch | ||
exec gh pr view --json 'baseRefName' --jq '.baseRefName' | ||
stdout 'long-lived-feature-branch' |
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
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
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