Skip to content

Commit

Permalink
fixing diff action (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann authored Oct 30, 2024
1 parent 523ad13 commit 9f10334
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/diff-design-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,19 @@ jobs:
// create diffs
const diffs = files.map(file => {
// run diff & store in file
const diff = shell.exec(`diff -u ${file.replace(cssFolder, 'base/' + cssFolder)} ${file}`)
// get filename
const regexRunnerPath = new RegExp('^[a-z\/]+\/dist', 'g')
const filename = file.replaceAll(regexRunnerPath,'')
// if file is new
if (!fs.existsSync(file.replace(cssFolder, 'base/' + cssFolder))) {
console.info('⚠️ File is new: ' + file + '\n')
return {
file: file.replaceAll('dist/', ''),
diff: ''
}
}
// run diff & store in file
const diff = shell.exec(`diff -u ${file.replace(cssFolder, 'base/' + cssFolder)} ${file}`)
console.log('Checking diff for ' + filename + '...')
Expand Down

0 comments on commit 9f10334

Please sign in to comment.