Expand gh secret acceptance tests

This commit builds on top of work previously done within acceptance tests around gh secret and remote disambiguation.

The choice of expanding this existing test rather than creating a new test was in order to keep context together within a single acceptance test rather than splitting it over multiple.
This commit is contained in:
Andy Feller 2025-03-04 14:16:00 -05:00
parent 23ea61d325
commit 0da037ca8f

View file

@ -34,3 +34,26 @@ stderr 'multiple remotes detected. please specify which repo to use by providing
# Secret delete requires disambiguation
! exec gh secret delete 'TEST_SECRET_NAME'
stderr 'multiple remotes detected. please specify which repo to use by providing the -R, --repo argument'
# Move out of the fork repo to test whether secret commands work without local repository context
cd ..
# Secret set using --repo flag does not require disambiguation
exec gh secret set 'TEST_SECRET_NAME' --body 'TEST_SECRET_VALUE' --repo ${ORG}/${REPO}-fork
# Secret list using --repo flag does not require disambiguation
exec gh secret list --repo ${ORG}/${REPO}-fork
stdout 'TEST_SECRET_NAME'
# Secret delete using --repo flag does not require disambiguation
exec gh secret delete 'TEST_SECRET_NAME' --repo ${ORG}/${REPO}-fork
# Secret set using GH_REPO env var does not require disambiguation
exec gh secret set 'TEST_SECRET_NAME2' --body 'TEST_SECRET_VALUE2' --repo ${ORG}/${REPO}-fork
# Secret list using --repo flag does not require disambiguation
exec gh secret list --repo ${ORG}/${REPO}-fork
stdout 'TEST_SECRET_NAME2'
# Secret delete using --repo flag does not require disambiguation
exec gh secret delete 'TEST_SECRET_NAME2' --repo ${ORG}/${REPO}-fork