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

Sync: Bi-directional sync from EvalAI to github #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion github/challenge_processing_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

if __name__ == "__main__":

if GITHUB_CONTEXT["event"]["head_commit"]["message"].startswith("evalai_bot"):
print("Sync from Evalai")
sys.exit(0)

Comment on lines +38 to +41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@savish28 can you explain why we need this check ?

Copy link
Member Author

@savish28 savish28 Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ram81, this is to prevent syncing back changes to EvalAi which came through evalai. So the commits we make start with this.

configs = load_host_configs(HOST_CONFIG_FILE_PATH)
if configs:
HOST_AUTH_TOKEN = configs[0]
Expand Down Expand Up @@ -62,7 +66,10 @@
zip_file = open(CHALLENGE_ZIP_FILE_PATH, "rb")
file = {"zip_configuration": zip_file}

data = {"GITHUB_REPOSITORY": GITHUB_REPOSITORY}
data = {
"GITHUB_REPOSITORY": GITHUB_REPOSITORY,
"GITHUB_AUTH_TOKEN": GITHUB_AUTH_TOKEN,
}

try:
response = requests.post(url, data=data, headers=headers, files=file)
Expand Down