-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve the c3 dependabot workflow (#4692)
improve the c3 dependabot e2e testing improve the c3 dependabot e2e testing workflow by - externalizing js code currently inlined in yml files - not relying on the dependabot PR descriptions which can potentially create issues and be unreliability
- Loading branch information
1 parent
38d656b
commit 222aa4a
Showing
2 changed files
with
31 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { execSync } = require("child_process"); | ||
|
||
module.exports = function () { | ||
const diff = execSync( | ||
"git diff HEAD~2 packages/create-cloudflare/src/frameworks/package.json" | ||
).toString(); | ||
|
||
const changedPackages = diff | ||
.match(/-\s*".*?":\s".*?",?/g) | ||
.map((match) => match.match(/-\s*"(.*)":/)?.[1]) | ||
.filter(Boolean); | ||
|
||
if (changedPackages.length === 0) { | ||
console.warn("No changes detected!"); | ||
return null; | ||
} else if (changedPackages.length > 1) { | ||
console.warn( | ||
`More then one package has changed (${changedPackages.join( | ||
", " | ||
)}), that's not currently supported` | ||
); | ||
throw new Error("More than one package bump detected"); | ||
} else { | ||
return changedPackages[0]; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters