-
Notifications
You must be signed in to change notification settings - Fork 698
Open
Labels
Description
Bitbucket released repository access token for controlled access to just one repository.
The python wrapper is throwing the error.
"When performing an edit, the author must have an e-mail address."
I need to know is there any way to include email/username in the requests payload ?
For eg.
from variables import *
import requests
import logging
logger=logging.getLogger()
logging.basicConfig(filename = 'myfile1.log', level=logging.DEBUG,
format='%(filename)s:%(lineno)s %(levelname)s:%(message)s')
url = f"https://{base_url}/rest/api/latest/projects/~{username}/repos/{repo}/browse/{file}"
contents=None
with open(file,"r") as f:
contents=f.read()
payload={
"content": contents,
"message": "Holla",
"branch": "master",
"sourceCommitId": "b244ade3b96",
}
data={
"author":{
"name":"example",
"emailAddress":"ex@example.com"
}
}
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {auth}"
}
response = requests.request(
"PUT",
url=url,
headers=headers,
files=payload,
'''maybe add a json or data payload'''
)
print(response)
print(response.content)
eabase
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]Push/edit file using Repository Access token[/-][+][Bitbucket] Push/edit file using Repository Access token[/+]