Added support for PLUGIN_REPOSITORY & PLUGIN_NAME

This commit is contained in:
jamelreid 2022-01-26 12:49:32 -05:00
parent e771145aa0
commit 8158343c74
1 changed files with 8 additions and 7 deletions

View File

@ -13,19 +13,20 @@ const {
beforeAll,
} = require( '@jest/globals' );
const { GITHUB_REPOSITORY, PLUGIN_NAME, GITHUB_TOKEN } = process.env;
const { GITHUB_REPOSITORY, PLUGIN_NAME, GITHUB_TOKEN, PLUGIN_REPOSITORY } = process.env;
// allows us to upload plugins from different repositories.
const pluginName = PLUGIN_NAME ? PLUGIN_NAME : 'WooCommerce';
const repository = PLUGIN_REPOSITORY ? PLUGIN_REPOSITORY : GITHUB_REPOSITORY;
let zipUrl;
let pluginPath;
utils.describeIf( GITHUB_REPOSITORY )(
`Upload and activate ${ PLUGIN_NAME } from ${ GITHUB_REPOSITORY }`,
utils.describeIf( GITHUB_REPOSITORY || PLUGIN_REPOSITORY )(
`Upload and activate ${ pluginName } from ${ repository }`,
() => {
beforeAll( async () => {
zipUrl = await getLatestReleaseZipUrl(
GITHUB_REPOSITORY,
GITHUB_TOKEN
);
zipUrl = await getLatestReleaseZipUrl( repository, GITHUB_TOKEN );
pluginPath = await getRemotePluginZip( zipUrl, GITHUB_TOKEN );