diff --git a/.github/workflows/a11y-contrast.yml b/.github/workflows/a11y-contrast.yml index 36aaeaea4..695d41e7c 100644 --- a/.github/workflows/a11y-contrast.yml +++ b/.github/workflows/a11y-contrast.yml @@ -47,10 +47,12 @@ jobs: const results = require('./color-contrast-check.json'); const faildChecks = results.reduce((acc, {failingContrast}) => acc + failingContrast, 0); + // prepare outputs for all failed themes const failedResults = results.filter(themeResults => themeResults.failingContrast > 0).map(({theme, failingContrast, markdownTable}) => ({ - title: `# ❌ \`${theme}\`: ${failingContrast} checks failed`, + title: `# ❌ \`${theme}\`: ${failingContrast} checks failed`, body: `${markdownTable}` + identifier: `` })) // prepare summary body @@ -101,6 +103,7 @@ jobs: with: script: | const results = ${{ steps.check-results.outputs.failedResults }} + const WORKFLOW_SUMMARY_URL = `https://github.com/${{env.GITHUB_REPOSITORY}}/actions/runs/${{env.GITHUB_RUN_ID}}` // get comments @@ -110,30 +113,47 @@ jobs: repo: context.repo.repo }); - for (const {title, body} of results) { - // get token issue - const tokenCheckComment = comments.filter(comment => comment.body.includes(title)); - const outputBody = `${title}\n\n${body}\n\n→ Details` + // get comments of token issues + let currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart))); - // if token issue exists, update it - if(tokenCheckComment.length > 0) { - await github.rest.issues.updateComment({ - comment_id: tokenCheckComment[0].id, + // get token issue + const tokenCheckComment = comments.filter(comment => comment.body.includes("")); + + // if token issue exists, update it + if(tokenCheckComment.length > 0) { + for (const comment of tokenCheckComment) { + await github.rest.issues.deleteComment({ + comment_id: comment.id, owner: context.repo.owner, repo: context.repo.repo, - body: outputBody }) } + } + + for (const {title, body, indentifier} of results) { + // get token issue + + const outputBody = `${title}\n\n${body}\n\n→ Details${indentifier}` // if token issue does not exist, create it - else { - await github.rest.issues.createComment({ - issue_number: context.issue.number, + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: outputBody + }) + } + + // if token issue exists, update it + if(currentComments.length > 0) { + await currentComments.map(comment => { + console.log('deleting comment', comment.id, comment) + github.rest.issues.deleteComment({ + comment_id: comment.id, owner: context.repo.owner, repo: context.repo.repo, - body: outputBody }) - } + }) } Fail_action_on_contrast_failing: @@ -165,15 +185,17 @@ jobs: }); // get token issue - const tokenCheckComment = comments.filter(comment => comment.body.includes('## Design Token Contrast Check')); + const tokenCheckComment = comments.filter(comment => comment.body.includes("")); // if token issue exists, update it if(tokenCheckComment.length > 0) { - await github.rest.issues.deleteComment({ - comment_id: tokenCheckComment[0].id, - owner: context.repo.owner, - repo: context.repo.repo, - }) + for (const comment of tokenCheckComment) { + await github.rest.issues.deleteComment({ + comment_id: comment.id, + owner: context.repo.owner, + repo: context.repo.repo, + }) + } } // remove summary diff --git a/src/tokens/base/color/dark/dark.json5 b/src/tokens/base/color/dark/dark.json5 index 44eb774c0..2d8db36d5 100644 --- a/src/tokens/base/color/dark/dark.json5 +++ b/src/tokens/base/color/dark/dark.json5 @@ -264,7 +264,7 @@ }, green: { '0': { - $value: '#aff5b4', + $value: '#70e691', $type: 'color', $extensions: { 'org.primer.figma': { @@ -273,7 +273,7 @@ }, }, '1': { - $value: '#7ee787', + $value: '#1edc5a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -282,7 +282,7 @@ }, }, '2': { - $value: '#56d364', + $value: '#13c351', $type: 'color', $extensions: { 'org.primer.figma': { @@ -291,7 +291,7 @@ }, }, '3': { - $value: '#3fb950', + $value: '#0cb64d', $type: 'color', $extensions: { 'org.primer.figma': { @@ -300,7 +300,7 @@ }, }, '4': { - $value: '#2ea043', + $value: '#048f3e', $type: 'color', $extensions: { 'org.primer.figma': { @@ -309,7 +309,7 @@ }, }, '5': { - $value: '#238636', + $value: '#00873D', $type: 'color', $extensions: { 'org.primer.figma': { @@ -318,7 +318,7 @@ }, }, '6': { - $value: '#196c2e', + $value: '#005c2c', $type: 'color', $extensions: { 'org.primer.figma': { @@ -327,7 +327,7 @@ }, }, '7': { - $value: '#0f5323', + $value: '#004725', $type: 'color', $extensions: { 'org.primer.figma': { @@ -336,7 +336,7 @@ }, }, '8': { - $value: '#033a16', + $value: '#00331c', $type: 'color', $extensions: { 'org.primer.figma': { @@ -345,7 +345,7 @@ }, }, '9': { - $value: '#04260f', + $value: '#002918', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/base/color/light/light.json5 b/src/tokens/base/color/light/light.json5 index 29e2e5230..d850777d2 100644 --- a/src/tokens/base/color/light/light.json5 +++ b/src/tokens/base/color/light/light.json5 @@ -264,7 +264,7 @@ }, green: { '0': { - $value: '#dafbe1', + $value: '#cbf6d7', $type: 'color', $extensions: { 'org.primer.figma': { @@ -273,7 +273,7 @@ }, }, '1': { - $value: '#aceebb', + $value: '#8aefaa', $type: 'color', $extensions: { 'org.primer.figma': { @@ -282,7 +282,7 @@ }, }, '2': { - $value: '#6fdd8b', + $value: '#16da5a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -291,7 +291,7 @@ }, }, '3': { - $value: '#4ac26b', + $value: '#0cc051', $type: 'color', $extensions: { 'org.primer.figma': { @@ -300,7 +300,7 @@ }, }, '4': { - $value: '#2da44e', + $value: '#05a347', $type: 'color', $extensions: { 'org.primer.figma': { @@ -309,7 +309,7 @@ }, }, '5': { - $value: '#1a7f37', + $value: '#00873D', $type: 'color', $extensions: { 'org.primer.figma': { @@ -318,7 +318,7 @@ }, }, '6': { - $value: '#116329', + $value: '#007036', $type: 'color', $extensions: { 'org.primer.figma': { @@ -327,7 +327,7 @@ }, }, '7': { - $value: '#044f1e', + $value: '#006132', $type: 'color', $extensions: { 'org.primer.figma': { @@ -336,7 +336,7 @@ }, }, '8': { - $value: '#003d16', + $value: '#004d2a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -345,7 +345,7 @@ }, }, '9': { - $value: '#002d11', + $value: '#003821', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/functional/color/light/patterns-light.json5 b/src/tokens/functional/color/light/patterns-light.json5 index 934d1ecff..19b94e664 100644 --- a/src/tokens/functional/color/light/patterns-light.json5 +++ b/src/tokens/functional/color/light/patterns-light.json5 @@ -772,7 +772,7 @@ scopes: ['bgColor'], }, }, - } + }, }, }, button: { @@ -2089,7 +2089,7 @@ underlineNav: { borderColor: { active: { - $value: '{base.color.coral.3}', + $value: '#FD794F', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/functional/color/light/primitives-light.json5 b/src/tokens/functional/color/light/primitives-light.json5 index 4ed7b0c12..152d88e27 100644 --- a/src/tokens/functional/color/light/primitives-light.json5 +++ b/src/tokens/functional/color/light/primitives-light.json5 @@ -136,7 +136,7 @@ }, }, success: { - $value: '{base.color.green.5}', + $value: '{base.color.green.6}', $type: 'color', $extensions: { 'org.primer.figma': { @@ -475,7 +475,7 @@ }, }, emphasis: { - $value: '{base.color.green.4}', + $value: '{base.color.green.5}', $type: 'color', $extensions: { 'org.primer.figma': { @@ -488,10 +488,6 @@ }, }, }, - mix: { - color: '{base.color.green.5}', - weight: 0.75, - }, }, }, open: {