cli/acceptance/testdata/variable/variable-org.txtar
Andy Feller 6192ac74df Update variable testscripts based on secret
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.
2024-10-21 16:02:26 -04:00

20 lines
642 B
Text

# Setup environment variables used for testscript
env2upper VAR_NAME=${SCRIPT_NAME}_${RANDOM_STRING}
# Confirm organization variable does not exist, will fail admin:org scope missing
exec gh variable list --org $ORG
! stdout $VAR_NAME
# Create an organization variable
exec gh variable set $VAR_NAME --org $ORG --body 'just an org variable'
# Defer organization variable cleanup
defer gh variable delete $VAR_NAME --org $ORG
# Verify new organization variable exists
exec gh variable list --org $ORG
stdout $VAR_NAME
# Verify organization variable can be retrieved
exec gh variable get $VAR_NAME --org $ORG
stdout 'just an org variable'