From bdfec5018608302a9f2fbcac57581b343427f612 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:43:06 -0600 Subject: [PATCH] fix(pr create): use REPO var in AT --- .../testdata/pr/pr-create-no-local-repo.txtar | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/acceptance/testdata/pr/pr-create-no-local-repo.txtar b/acceptance/testdata/pr/pr-create-no-local-repo.txtar index a6e06cdcd..cb42d99f8 100644 --- a/acceptance/testdata/pr/pr-create-no-local-repo.txtar +++ b/acceptance/testdata/pr/pr-create-no-local-repo.txtar @@ -1,17 +1,20 @@ # Use gh as a credential helper exec gh auth setup-git +# Setup environment variables used for testscript +env REPO=${SCRIPT_NAME}-${RANDOM_STRING} + # Create a repository with a file so it has a default branch -exec gh repo create ${ORG}/${SCRIPT_NAME}-${RANDOM_STRING} --add-readme --private +exec gh repo create ${ORG}/${REPO} --add-readme --private # Defer repo cleanup -defer gh repo delete --yes ${ORG}/${SCRIPT_NAME}-${RANDOM_STRING} +defer gh repo delete --yes ${ORG}/${REPO} # Clone the repo -exec gh repo clone ${ORG}/${SCRIPT_NAME}-${RANDOM_STRING} +exec gh repo clone ${ORG}/${REPO} # Prepare a branch to PR -cd ${SCRIPT_NAME}-${RANDOM_STRING} +cd ${REPO} exec git checkout -b feature-branch exec git commit --allow-empty -m 'Empty Commit' exec git push -u origin feature-branch @@ -20,5 +23,5 @@ exec git push -u origin feature-branch cd ${WORK} # Create the PR -exec gh pr create --title 'Feature Title' --body 'Feature Body' --repo ${ORG}/${SCRIPT_NAME}-${RANDOM_STRING} --head feature-branch -stdout https://${GH_HOST}/${ORG}/${SCRIPT_NAME}-${RANDOM_STRING}/pull/1 \ No newline at end of file +exec gh pr create --title 'Feature Title' --body 'Feature Body' --repo ${ORG}/${REPO} --head feature-branch +stdout https://${GH_HOST}/${ORG}/${REPO}/pull/1 \ No newline at end of file