Skip to content

Commit

Permalink
feat: update reviewflow colors based on github palette
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Jan 22, 2023
1 parent 2303376 commit d0ed641
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 45 deletions.
42 changes: 12 additions & 30 deletions src/__fixtures__/labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node_id": "MDU6TGFiZWwyMzYyNjY1OTA3",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:arrows_counterclockwise:%20update%20branch",
"name": ":arrows_counterclockwise: update branch",
"color": "64DD17",
"color": "1f6feb",
"default": false,
"description": "Synced by reviewflow for merge/update-branch"
},
Expand All @@ -13,7 +13,7 @@
"node_id": "LA_kwDOCgFbpc8AAAABJeMaXA",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:green_heart:%20checks/fail",
"name": ":green_heart: checks/fail",
"color": "e11d21",
"color": "da3633",
"default": false,
"description": "Synced by reviewflow for checks/failed"
},
Expand All @@ -22,7 +22,7 @@
"node_id": "LA_kwDOCgFbpc8AAAABJeMaRw",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:green_heart:%20checks/in-progress",
"name": ":green_heart: checks/in-progress",
"color": "B2E1FF",
"color": "6e7681",
"default": false,
"description": "Synced by reviewflow for checks/in-progress"
},
Expand All @@ -31,7 +31,7 @@
"node_id": "LA_kwDOCgFbpc8AAAABJeMafg",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:green_heart:%20checks/passed",
"name": ":green_heart: checks/passed",
"color": "64DD17",
"color": "238636",
"default": false,
"description": "Synced by reviewflow for checks/passed"
},
Expand All @@ -40,7 +40,7 @@
"node_id": "MDU6TGFiZWwxMjEwNDMyOTYz",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/approved",
"name": ":ok_hand: code/approved",
"color": "64DD17",
"color": "238636",
"default": false,
"description": "Synced by reviewflow for code/approved"
},
Expand All @@ -49,7 +49,7 @@
"node_id": "MDU6TGFiZWwxMjEwNDMyOTYy",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/changes-requested",
"name": ":ok_hand: code/changes-requested",
"color": "e11d21",
"color": "da3633",
"default": false,
"description": "Synced by reviewflow for code/changes-requested"
},
Expand All @@ -58,7 +58,7 @@
"node_id": "MDU6TGFiZWwxMjEwNDMyOTIw",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/needs-review",
"name": ":ok_hand: code/needs-review",
"color": "FFD57F",
"color": "9e6a03",
"default": false,
"description": "Synced by reviewflow for code/needs-review"
},
Expand All @@ -67,34 +67,16 @@
"node_id": "MDU6TGFiZWwxMjEwNDMyOTM3",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/review-requested",
"name": ":ok_hand: code/review-requested",
"color": "B2E1FF",
"color": "6e7681",
"default": false,
"description": "Synced by reviewflow for code/review-requested"
},
{
"id": 1285316261,
"node_id": "MDU6TGFiZWwxMjg1MzE2MjYx",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:recycle:%20delete%20branch%20after%20merge",
"name": ":recycle: delete branch after merge",
"color": "64DD17",
"default": false,
"description": null
},
{
"id": 1285313537,
"node_id": "MDU6TGFiZWwxMjg1MzEzNTM3",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:recycle:%20merge/delete-branch",
"name": ":recycle: merge/delete-branch",
"color": "64DD17",
"default": false,
"description": null
},
{
"id": 1285313520,
"node_id": "MDU6TGFiZWwxMjg1MzEzNTIw",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:vertical_traffic_light:%20automerge",
"name": ":vertical_traffic_light: automerge",
"color": "64DD17",
"color": "238636",
"default": false,
"description": "Synced by reviewflow for merge/automerge"
},
Expand All @@ -103,7 +85,7 @@
"node_id": "MDU6TGFiZWwxNTE3MDg5MzEz",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:vertical_traffic_light:%20skip-ci",
"name": ":vertical_traffic_light: skip-ci",
"color": "e1e8ed",
"color": "a5d6ff",
"default": false,
"description": "Synced by reviewflow for merge/skip-ci"
},
Expand All @@ -112,7 +94,7 @@
"node_id": "MDU6TGFiZWwxNTI2NjUyODU2",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:warning:%20Breaking%20Changes",
"name": ":warning: Breaking Changes",
"color": "ef7934",
"color": "9e6a03",
"default": false,
"description": "Synced by reviewflow for breaking-changes"
},
Expand Down Expand Up @@ -157,7 +139,7 @@
"node_id": "MDU6TGFiZWwxMzc2NzI1NTAx",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/feature-branch",
"name": "feature-branch",
"color": "7FCEFF",
"color": "1f6feb",
"default": false,
"description": "Synced by reviewflow for feature-branch"
},
Expand Down
2 changes: 1 addition & 1 deletion src/__fixtures__/pull_request_30.edited.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"node_id": "MDU6TGFiZWwxMjEwNDMyOTIw",
"url": "https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/needs-review",
"name": ":ok_hand: code/needs-review",
"color": "FFD57F",
"color": "9e6a03",
"default": false,
"description": "Synced by reviewflow for code/needs-review"
}
Expand Down
38 changes: 26 additions & 12 deletions src/accountConfigs/christophehurpeau.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import type { Config } from './types';

const githubPalette = {
accentEmphasis: '#1f6feb',
neutralEmphasis: '#6e7681',
successEmphasis: '#238636',
attentionEmphasis: '#9e6a03',
severeEmphasis: '#bd561d',
dangerEmphasis: '#da3633',
doneEmphasis: '#8957e5',
scaleBlue1: '#a5d6ff',
};

const config: Config<'dev', never> = {
autoAssignToCreator: true,
trimTitle: true,
Expand Down Expand Up @@ -28,56 +39,59 @@ const config: Config<'dev', never> = {
/* checks */
'checks/in-progress': {
name: ':green_heart: checks/in-progress',
color: '#B2E1FF',
color: githubPalette.neutralEmphasis,
},
'checks/failed': {
name: ':green_heart: checks/fail',
color: githubPalette.dangerEmphasis,
},
'checks/failed': { name: ':green_heart: checks/fail', color: '#e11d21' },
'checks/passed': {
name: ':green_heart: checks/passed',
color: '#64DD17',
color: githubPalette.successEmphasis,
},

/* code */
'code/needs-review': {
name: ':ok_hand: code/needs-review',
color: '#FFD57F',
color: githubPalette.attentionEmphasis,
},
'code/review-requested': {
name: ':ok_hand: code/review-requested',
color: '#B2E1FF',
color: githubPalette.neutralEmphasis,
},
'code/changes-requested': {
name: ':ok_hand: code/changes-requested',
color: '#e11d21',
color: githubPalette.dangerEmphasis,
},
'code/approved': {
name: ':ok_hand: code/approved',
color: '#64DD17',
color: githubPalette.successEmphasis,
},

/* auto merge */
'merge/automerge': {
name: ':vertical_traffic_light: automerge',
color: '#64DD17',
color: githubPalette.successEmphasis,
},
'merge/skip-ci': {
name: ':vertical_traffic_light: skip-ci',
color: '#e1e8ed',
color: githubPalette.scaleBlue1,
},
'merge/update-branch': {
name: ':arrows_counterclockwise: update branch',
color: '#64DD17',
color: githubPalette.accentEmphasis,
},

/* feature-branch */
'feature-branch': {
name: 'feature-branch',
color: '#7FCEFF',
color: githubPalette.accentEmphasis,
},

/* infos */
'breaking-changes': {
name: ':warning: Breaking Changes',
color: '#ef7934',
color: githubPalette.attentionEmphasis,
},
},

Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/opened.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('opened', (): void => {
node_id: 'MDU6TGFiZWwxMjEwNDMyOTIw',
url: 'https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/needs-review',
name: ':ok_hand: code/needs-review',
color: 'FFD57F',
color: '9e6a03',
default: false,
description: null,
},
Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/readyForReview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('edited', (): void => {
node_id: 'MDU6TGFiZWwxMjEwNDMyOTIw',
url: 'https://api.github.com/repos/reviewflow/reviewflow-test/labels/:ok_hand:%20code/needs-review',
name: ':ok_hand: code/needs-review',
color: 'FFD57F',
color: '9e6a03',
default: false,
description: null,
},
Expand Down

0 comments on commit d0ed641

Please sign in to comment.