Skip to content

Commit

Permalink
Fix github action for too long diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Dec 11, 2023
1 parent f88108a commit 1f015a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/munge-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ jobs:
const commentText = 'Diff for ' + context.payload.pull_request.head.sha + ':';
const fs = require('fs');
const diff = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/oi-pr.diff').toString().trimEnd();
var diff = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/oi-pr.diff').toString().trimEnd();
// GitHub has limitation 2^16 of body length
diff = diff < 60000 ? diff : diff.substring(0, 60000) + '\n=== TRUNCATED ===';
var body = "<details>\n<summary>" + commentText + "</summary>\n\n```diff\n" + diff + "\n```\n\n</details>";
const maint = fs.readFileSync(process.env.GITHUB_WORKSPACE + '/oi-pr.maint').toString().trimEnd();
if (maint.length > 0) {
Expand Down

0 comments on commit 1f015a0

Please sign in to comment.