diff --git a/acceptance/testdata/secret/secret-require-remote-disambiguation.txtar b/acceptance/testdata/secret/secret-require-remote-disambiguation.txtar index f4d1bbb4a..ebf5c79db 100644 --- a/acceptance/testdata/secret/secret-require-remote-disambiguation.txtar +++ b/acceptance/testdata/secret/secret-require-remote-disambiguation.txtar @@ -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