mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-06 07:38:54 +08:00
* Revert "remove interface check workflow (#14290)"
This reverts commit a20fc2d837.
* Workflow: modify "interface check" workflow to solve security problem
---------
Co-authored-by: PP <[email protected]>
21 lines
625 B
JavaScript
21 lines
625 B
JavaScript
const ps = require('path');
|
|
const fs = require('fs');
|
|
|
|
const interfaceDiffPath = ps.join(__dirname, '../../interface-diff.txt');
|
|
let reportContent = fs.readFileSync(interfaceDiffPath, 'utf8');
|
|
|
|
if (reportContent.includes('@')) {
|
|
reportContent = reportContent.split('\n').slice(3).join('\n');
|
|
reportContent = `## Interface Check Report
|
|
\`\`\`diff
|
|
! WARNING this pull request has changed these public interfaces:
|
|
|
|
${reportContent}
|
|
\`\`\`
|
|
`;
|
|
} else {
|
|
reportContent = `## Interface Check Report
|
|
This pull request does not change any public interfaces !`;
|
|
}
|
|
fs.writeFileSync(interfaceDiffPath, reportContent, 'utf8');
|