We are looking at RETOOL for github integration I am unable to get the Post Tree method working.
The help suggests the following:
Get SHA for base_tree
So using the get reference for main branch that works fine.
{
"ref": "refs/heads/main",
"node_id": "REF_kwDOKe2W069yZWZzL2hlYWRzL21haW4",
"url": "https://api.github.com/repos/R2RHONEY/elsevier_snowflake_admin/git/refs/heads/main",
"object": {
"sha": "8cc121745f196b91e93b34b1ca94b573e7ee3e42",
"type": "commit",
"url": "https://api.github.com/repos/R2RHONEY/elsevier_snowflake_admin/git/commits/8cc121745f196b91e93b34b1ca94b573e7ee3e42"
}
}
Then I can get the tree of the main branch
As you can see there is a READ.me file blob
{
"sha": "8cc121745f196b91e93b34b1ca94b573e7ee3e42",
"url": "https://api.github.com/repos/R2RHONEY/elsevier_snowflake_admin/git/trees/8cc121745f196b91e93b34b1ca94b573e7ee3e42",
"tree": [
{
"path": "README.md",
"mode": "100644",
"type": "blob",
"sha": "363a17c32e595ec50b88922cd43386e6cdbf3453",
"size": 74,
"url": "https://api.github.com/repos/R2RHONEY/elsevier_snowflake_admin/git/blobs/363a17c32e595ec50b88922cd43386e6cdbf3453"
},
{
"path": "infrastructure",
"mode": "040000",
"type": "tree",
"sha": "3e2a1b0ccafdab0d3e3c32e12e18486300ecfd20",
"url": "https://api.github.com/repos/R2RHONEY/elsevier_snowflake_admin/git/trees/3e2a1b0ccafdab0d3e3c32e12e18486300ecfd20"
}
],
"truncated": false
}
I want to amend that file with some text
The create tree does not work and has a bug.
I correctly enter the tree and parameters
And base tree ->8cc121745f196b91e93b34b1ca94b573e7ee3e42
tree
[
{
"mode": "100644",
"type": "blob",
"path": "README.md",
"content": "jhjhv"
}
]
I tried adding content or a blog sha from create blob method and still no luck!
The error message is the same every time
This is correct below for the object type
[
{
"mode": "100644",
"type": "blob",
"path": "README.md",
"content": "jhjhv"
}
]
I have tried everything and always returns same error message , I have tested for hours it never works!
{
"message": "Must supply a valid tree.mode",
"documentation_url": "Git trees - GitHub Docs"
}