github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/src/main.ts (about)

     1  import * as core from '@actions/core';
     2  import { Utils } from './utils';
     3  
     4  async function main() {
     5      try {
     6          core.startGroup('Frogbot');
     7          const eventName: string = await Utils.setFrogbotEnv();
     8          await Utils.addToPath();
     9          switch (eventName) {
    10              case 'pull_request':
    11              case 'pull_request_target':
    12                  await Utils.execScanPullRequest();
    13                  break;
    14              case 'push':
    15              case 'schedule':
    16              case 'workflow_dispatch':
    17                  await Utils.execCreateFixPullRequests();
    18                  break;
    19              default:
    20                  core.setFailed(eventName + ' event is not supported by Frogbot');
    21          }
    22      } catch (error) {
    23          core.setFailed((<any>error).message);
    24      } finally {
    25          core.endGroup();
    26      }
    27  }
    28  
    29  main();