Skip to content

Commit

Permalink
Release v2.1.0 - Support re-run
Browse files Browse the repository at this point in the history
- Enable support for re-run checks
  • Loading branch information
sumits-systango committed Jul 16, 2019
1 parent 2e574ed commit 2546865
Show file tree
Hide file tree
Showing 13 changed files with 744 additions and 533 deletions.
43 changes: 43 additions & 0 deletions constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
configFileName: process.env.REGEX_CONFIG_FILE_NAME,
conclusion_status: {
SUCCESS: 'success',
FAILURE: 'failure',
NEUTRAL: 'neutral',
CANCELLED: 'cancelled',
TIMED_OUT: 'timed_out',
ACTION_REQUIRED: 'action_required'
},
messages: {
valid_commit_message: 'Commit messages are valid',
invalid_commit_message: 'Commit messages are invalid',
valid_pull_request_message: 'Pull request title is valid',
invalid_pull_request_message: 'Pull request title is invalid',
multiple_other_invalid_message: 'other messages are invalid',
single_other_invalid_message: 'other message is invalid',
pr_configuration_not_set: 'Pull request title format is not configured',
commit_message_configuration_not_set:
'Commit message format is not configured',
pr_and_commit_message_configuration_not_set:
'Pull request title and commit message format are not configured',
home_page_message: 'Commit Message Lint App'
},
CHECK_RUN_STATUS_COMPLETED: 'completed',
CHECK_RUN_NAME: 'Commit Message Lint',
output_title_success: 'Message validation passed!!!',
output_title_fail: 'Message validation failed!!!',
INVALID_COMMIT_LIMIT: 3,
USER_AGENT: 'commit-message-lint-app',
invalid_commit_list: {
commit_id: 'sha:',
commit_message: 'message:'
},
REGEX: {
MERGE_COMMIT_REGEX: '/^(Merge pull request)/'
},
events: {
PULL_REQUEST_OPEN: 'pull_request.opened',
CHECK_RUN_REREQUESTED: 'check_run.rerequested',
CHECK_SUITE_REREQUESTED: 'check_suite.rerequested'
}
};
14 changes: 14 additions & 0 deletions controllers/checks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { listForSuite } = require('../helpers/checks');

module.exports.listForSuite = async (app, context) => {
try {
const owner = context.payload.repository.owner.login;
const repository = context.payload.repository.name;
const checkSuiteId = context.payload.check_suite.id;
const listOfCheckRuns = await listForSuite(context, owner, repository, checkSuiteId);
return listOfCheckRuns;
} catch (error) {
app.log(error);
return error;
}
};
Loading

0 comments on commit 2546865

Please sign in to comment.