Skip to content

Commit

Permalink
feat: ignore other events
Browse files Browse the repository at this point in the history
  • Loading branch information
Slashgear committed May 4, 2022
1 parent c1554ac commit 53cd30a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
24 changes: 24 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import { info } from '@actions/core';

import { ConfigEntry, getBiggestEntry, parseConfig } from './config';
import { applyLabelOnPullRequest, getDiffSize, getFileSize, getPullRequest } from './pullRequest';
import * as github from '@actions/github';

export default async function run(): Promise<void> {
info('Parsing input data...');
const configuration: ConfigEntry[] = parseConfig();
info(`Config parsed`);

if (github.context.eventName != 'pull_request') {
info('Event is not pull request, doing nothing');
return;
}

const pullRequest = await getPullRequest();
const size = getFileSize(configuration, pullRequest.numberOfFiles);
info(`Level from size, ${size.label}`);
Expand Down

0 comments on commit 53cd30a

Please sign in to comment.