Skip to content

Commit

Permalink
Avoid truncation when copying Gists (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton authored Jul 23, 2024
1 parent 1a629a7 commit 6629f65
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/nsys-jax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,18 @@ jobs:
const pattern = new RegExp(`${PUBLISH_NOTEBOOK_FILES}`);
for (const [filename, fileObj] of Object.entries(srcData.files)) {
if (filename.match(pattern)) {
filesToUpdate[filename] = {
content: fileObj.content
};
// If the total gist size is too large, not all the content will have
// been returned and we need some extra requests.
if (fileObj.truncated) {
const { data } = await github.request(fileObj.raw_url)
filesToUpdate[filename] = {
content: new TextDecoder().decode(data)
};
} else {
filesToUpdate[filename] = {
content: fileObj.content
};
}
}
}
Expand Down

0 comments on commit 6629f65

Please sign in to comment.