Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content.update() not working for a branch #1117

Open
mscherfling opened this issue Nov 10, 2022 · 2 comments
Open

content.update() not working for a branch #1117

mscherfling opened this issue Nov 10, 2022 · 2 comments

Comments

@mscherfling
Copy link

I get a 409 attempting to update a branch file. The logs show

2022-11-10 15:10:39,888 DEBUG [models] PUT https://github.xxx.com/api/v3/repos/owner/repo/contents/create_file.txt?ref=test-branch9 with {'data': '{"message": "test-branch9 2", "content": "dGVzdC1icmFuY2g5IDI=", "sha": "3f108ed16ed0e4775c6a574d4d06701495e6084b"}'}
2022-11-10 15:10:40,024 DEBUG [connectionpool] https://github.xxx.com:443 "PUT /api/v3/repos/owner/repo/contents/create_file.txt?ref=test-branch9 HTTP/1.1" 409 198

I ran the same PUT successfully as a curl command, removing '?ref=test-branch9' and adding it into the data portion as "branch": "test-branch9"

We're currently on v3.1.23, but scheduled to upgrade to 3.3 shortly. Will the API interface change to correctly work in 3.3?

@sigmavirus24
Copy link
Owner

It's fixed in main but I don't recall if it's been released

https://github.com/sigmavirus24/github3.py/blob/main/src/github3/repos/contents.py#L188

@staticdev
Copy link
Collaborator

staticdev commented Nov 17, 2022

@sigmavirus24 I just checked last tag is from March 2022. This change should be in 3.2.0, but we some feature PRs, maybe time for a 3.3.0? There is deprecation of EOL Python 3.6 on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants