mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(GitHub Node): Fix issue preventing file edits on branches (#7734)
Github issue / Community forum post (link here to close automatically): https://github.com/n8n-io/n8n/issues/7614
This commit is contained in:
parent
db094f2d7e
commit
ce002a6cc6
|
@ -76,12 +76,13 @@ export async function getFileSha(
|
||||||
filePath: string,
|
filePath: string,
|
||||||
branch?: string,
|
branch?: string,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const getBody: IDataObject = {};
|
const query: IDataObject = {};
|
||||||
if (branch !== undefined) {
|
if (branch !== undefined) {
|
||||||
getBody.branch = branch;
|
query.ref = branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getEndpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
|
const getEndpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
|
||||||
const responseData = await githubApiRequest.call(this, 'GET', getEndpoint, getBody, {});
|
const responseData = await githubApiRequest.call(this, 'GET', getEndpoint, {}, query);
|
||||||
|
|
||||||
if (responseData.sha === undefined) {
|
if (responseData.sha === undefined) {
|
||||||
throw new NodeOperationError(this.getNode(), 'Could not get the SHA of the file.');
|
throw new NodeOperationError(this.getNode(), 'Could not get the SHA of the file.');
|
||||||
|
|
Loading…
Reference in a new issue