Skip to content

Commit

Permalink
fix: status max length
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Mar 17, 2021
1 parent ea8e887 commit 6a0906e
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 27 deletions.
38 changes: 27 additions & 11 deletions dist/index-node12-dev.cjs.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-node12-dev.cjs.js.map

Large diffs are not rendered by default.

38 changes: 27 additions & 11 deletions dist/index-node12.cjs.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-node12.cjs.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/accountConfigs/ornikar.ts
Expand Up @@ -53,10 +53,12 @@ const config: Config<'dev' | 'design', 'ops' | 'frontends' | 'backends'> = {
// eslint-disable-next-line unicorn/no-unsafe-regex
regExp: /^(?<revert>revert-\d+-)?(?<type>build|chore|ci|docs|feat|fix|perf|refactor|style|test)(?<scope>\/[a-z-]+)?\/(?<breaking>!)?(?<subject>.*)-(?<jiraIssue>[A-Z][\dA-Z]+-(\d+))$/,
warning: true,
status: 'branch-name',
error: ({ title }) => ({
title: `Branch name does not match commitlint conventional, ideal branch name would have been: ${title
.replace(/(\(|\):|:)\s*/g, '/')
.replace(/[\s,]+/g, '-')}`,
title: `Ideal branch name: "${title
.replace(/\s*\[no issue]$/, '')
.replace(/\s*(\(|\):|:)\s*/g, '/')
.replace(/[\s,]+/g, '-')}"`,
summary: '',
}),
},
Expand Down
4 changes: 4 additions & 0 deletions src/events/pr-handlers/actions/editOpenedPR.ts
Expand Up @@ -71,6 +71,10 @@ export const editOpenedPR = async <
if (match === null) {
if (rule.status) {
statuses.push({ name: rule.status, error: rule.error });
if (rule.warning) {
warnings.push({ title: `"${rule.status}"`, summary: '' });
return false;
}
}
if (rule.warning) {
warnings.push(rule.error);
Expand Down
4 changes: 4 additions & 0 deletions src/events/pr-handlers/actions/utils/createStatus.ts
Expand Up @@ -11,6 +11,10 @@ export default async function createStatus<
description: string,
url?: string,
): Promise<void> {
if (description.length > 140) {
context.log('description too long', { description });
description = description.slice(0, 140);
}
await context.octokit.repos.createCommitStatus(
context.repo({
context:
Expand Down

0 comments on commit 6a0906e

Please sign in to comment.