Skip to content

Commit

Permalink
Merge pull request #22 from ethanis/remove-status-check
Browse files Browse the repository at this point in the history
Remove external status check
  • Loading branch information
ethanis authored Jun 16, 2020
2 parents 57af0bc + 6c4d37f commit 0393fe1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Add the Nitpicker action to your workflow and allow access to the `secrets.GITHU

## Blocking comments

A blocking comment indicates that a PR containing changed files that match a specified path filter will be blocked from being completed. After the indicated file/folder has been removed from the PR, the blocking comment will be considered 'resolved' and the PR can be completed.
A blocking comment indicates that a PR containing changed files that match a specified path filter will fail the build job that the nitpicker is run in. After the indicated file/folder has been removed from the PR, the blocking comment will be considered 'resolved', the build job will succeed, and the PR can be completed.

## Common use-cases

Expand Down
14 changes: 6 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {
getChangedFiles,
writeComments,
getTargetState,
startCheck,
completeCheck,
updateComments,
resolveComments
} from './services';
Expand Down Expand Up @@ -38,16 +36,12 @@ async function run() {
return;
}

const octokit = new github.GitHub(token, {
previews: ['squirrel-girl']
});
const octokit = new github.GitHub(token);

const eventName = process.env.GITHUB_EVENT_NAME;

console.log('starting check');

const checkRun = await startCheck(octokit);

const changes: Change[] = await getChangedFiles(octokit, eventName);
const targetState = await getTargetState(octokit, comments, changes);

Expand All @@ -57,7 +51,11 @@ async function run() {
resolveComments(octokit, targetState.commentsToResolve)
]);

await completeCheck(octokit, checkRun.id, targetState.conclusion);
if (targetState.conclusion !== 'success') {
core.setFailed(
'nitpicker has failed due to blocking comments being applied'
);
}
} catch (error) {
core.setFailed(error.message);
}
Expand Down
32 changes: 0 additions & 32 deletions src/services/checks.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './configReader';
export * from './comments';
export * from './changes';
export * from './checks';
export * from './context';
export * from './state';

0 comments on commit 0393fe1

Please sign in to comment.