This commit refactors a bit of the variable testscripts given the changes in the secret testscripts efforts, removing potentially unnecessary assertions and making these look more similar to other testscripts.
28 lines
715 B
Text
28 lines
715 B
Text
# Setup environment variables used for testscript
|
|
env REPO=${SCRIPT_NAME}-${RANDOM_STRING}
|
|
env VAR_NAME=TESTSCRIPTS
|
|
|
|
# Create a repository where the variable will be registered
|
|
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
|
|
cd $REPO
|
|
|
|
# Verify repository variable does not exist
|
|
exec gh variable list
|
|
! stdout $VAR_NAME
|
|
|
|
# Create a repository variable
|
|
exec gh variable set $VAR_NAME --body 'just a repo variable'
|
|
|
|
# Verify new repository variable exists
|
|
exec gh variable list
|
|
stdout $VAR_NAME
|
|
|
|
# Verify repository variable can be retrieved
|
|
exec gh variable get $VAR_NAME
|
|
stdout 'just a repo variable'
|