Github Integration - Post Tree bug

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! :frowning:

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"
}

Hello @R2rhoney ,

Thank you for sending in your question.

I'm sorry to hear you're experiencing issues with Github integration in Retool. Judging from your current settings, the mode, type, path, and content values appear to be correct. However, ensure the mode value is entered as a string. In your case, it should be "100644".

According to GitHub's documentation, the file modes that can be used in tree definition are:

  • "100644": Default if not specified. It represents a blob, a file.
  • "100755": Represents an executable file.
  • "040000": Represents a directory.
  • "160000": A gitlink which has SHA-1 of the commit the submodule points to.

Ensure your SHA values are accurate and valid as Retool might require a correctly formatted SHA.

Before moving forward, verify:

  1. The Retool instance has the required permissions to the GitHub repository.
  2. The system time where Retool is running is accurate. Restart the system if consistent 'Issued at' claim ('iat') errors appear in your Retool logs.
  3. The Git history hasn't been manually rewritten. Manually rewriting can make previous commit SHA tracked by Retool invalid, causing an error.

If the issue persists consider using the Github Web UI or a local Git client as a workaround. Also, do report this error to Retool and GitHub's customer support, as they might be better equipped to identify potential bugs in the system.

For a more detailed understanding of creating a tree via API, consult the official Github documentation.

Hope this gets you closer to a solution.
-Brett