Skip to content
Snippets Groups Projects
Select Git revision
  • af003226599eafeac5e4494b18e22bd628b66a87
  • develop default protected
  • feature/module-gpiod
  • 0.5.6
  • 0.5.5
  • 0.5.4
  • 0.5.3
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.1
  • 0.4.0
  • 0.3.2
  • 0.3.1
  • 0.3.0
  • 0.2.8
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
23 results

setup.py

Blame
  • check-existing.ts 1023 B
    import { logger } from '../../logger';
    import { RenovateConfig } from '../../config';
    import { platform } from '../../platform';
    import { REPOSITORY_CHANGED } from '../../constants/error-messages';
    
    /** TODO: Proper return type */
    export async function prAlreadyExisted(
      config: RenovateConfig
    ): Promise<any | null> {
      logger.trace({ config }, 'prAlreadyExisted');
      if (config.recreateClosed) {
        logger.debug('recreateClosed is true');
        return null;
      }
      logger.debug('recreateClosed is false');
      // Return if same PR already existed
      const pr = await platform.findPr({
        branchName: config.branchName,
        prTitle: config.prTitle,
        state: '!open',
      });
      if (pr) {
        logger.debug('Found closed PR with current title');
        const prDetails = await platform.getPr(pr.number);
        // istanbul ignore if
        if (prDetails.state === 'open') {
          logger.debug('PR reopened');
          throw new Error(REPOSITORY_CHANGED);
        }
        return pr;
      }
      logger.debug('prAlreadyExisted=false');
      return null;
    }