Merge pull request #29551 from woocommerce/fix/allow-local-slackbot
Allow local slackbot
This commit is contained in:
commit
be44da32de
|
@ -1,5 +1,6 @@
|
|||
const { createReadStream } = require( 'fs' );
|
||||
const { WebClient, ErrorCode } = require( '@slack/web-api' );
|
||||
const { getTestConfig } = require( '../../utils' );
|
||||
const {
|
||||
GITHUB_ACTIONS,
|
||||
GITHUB_REF,
|
||||
|
@ -37,7 +38,12 @@ const initializeSlack = () => {
|
|||
return false;
|
||||
}
|
||||
if ( ! GITHUB_ACTIONS && ! TRAVIS_PULL_REQUEST_BRANCH ) {
|
||||
return false;
|
||||
const testConfig = getTestConfig();
|
||||
return {
|
||||
branch: 'local environment',
|
||||
commit: 'latest',
|
||||
webUrl: testConfig.url,
|
||||
};
|
||||
}
|
||||
// Build PR info
|
||||
if ( GITHUB_ACTIONS ) {
|
||||
|
@ -80,7 +86,9 @@ export async function sendFailedTestMessageToSlack( testName ) {
|
|||
// Check the code property and log the response
|
||||
if ( error.code === ErrorCode.PlatformError || error.code === ErrorCode.RequestError ||
|
||||
error.code === ErrorCode.RateLimitedError || error.code === ErrorCode.HTTPError ) {
|
||||
console.log( error.data );
|
||||
if ( error.data.error != 'channel_not_found' ) {
|
||||
console.log(error.data);
|
||||
}
|
||||
} else {
|
||||
// Some other error, oh no!
|
||||
console.log(
|
||||
|
|
Loading…
Reference in New Issue