Minor polish / consistency

This commit is contained in:
Andy Feller 2024-10-17 16:02:39 -04:00
parent e91052dd9b
commit e335113706
2 changed files with 12 additions and 10 deletions

View file

@ -1,18 +1,19 @@
# Force GitHub CLI to treat testscript as TTY
env GH_FORCE_TTY=80
env REPO=$SCRIPT_NAME-$RANDOM_STRING
# Create a repository where the secret will be registered
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
cd $SCRIPT_NAME-$RANDOM_STRING
exec gh repo clone $ORG/$REPO
cd $REPO
# Create a repository environment, will fail if organization does not have environment support
exec gh api /repos/$ORG/$SCRIPT_NAME-$RANDOM_STRING/environments/testscripts -X PUT --jq '.name'
exec gh api /repos/$ORG/$REPO/environments/testscripts -X PUT --jq '.name'
stdout 'testscripts'
# Verify no repository environment secrets exist

View file

@ -1,17 +1,18 @@
# Setup environment variables to force TTY
# Force GitHub CLI to treat testscript as TTY
env GH_FORCE_TTY=80
env REPO=$SCRIPT_NAME-$RANDOM_STRING
# Create a repository where the secret will be registered
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
cd $REPO
# Verify no repository secrets exist
cd $SCRIPT_NAME-$RANDOM_STRING
exec gh secret list
stderr 'no secrets found'