Releases: gr2m/octokit-plugin-create-pull-request
Releases · gr2m/octokit-plugin-create-pull-request
v6.0.0
v5.1.1
v5.1.0
v5.0.0
5.0.0 (2023-06-04)
Features
BREAKING CHANGES
- The meaning of
null
has changed!
Previously the following snippet was causing a file deletion.
files: {
"file/to/delete.txt": null
}
If you want to retain this behavior you must use the DELETE_FILE Symbol
import { createPullRequest, DELETE_FILE } from 'octokit-plugin-create-pull-request';
files: {
"file/to/delete.txt": DELETE_FILE
}
If you want to trigger a file deletion from an update function, you can now do so by returning the deleteFile Symbol.
import { createPullRequest, DELETE_FILE } from 'octokit-plugin-create-pull-request';
files: {
"file/to/delete.txt": ({ exists, encoding, content }) => {
const fileContent = Buffer.from(content, encoding).toString("utf-8")
if (fileContent.includes('abc')) {
// trigger file deletion
return DELETE_FILE
}
// do not alter file content
return null;
}
}