Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions .github/workflows/process_challenge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

name: evalai-challenge
on:
push:
branches: [challenge]
push: {}
pull_request:
types: [opened, synchronize, reopened, edited]
branches: [challenge]
jobs:
build:
runs-on: ubuntu-20.04
Expand All @@ -23,14 +21,14 @@ jobs:
if [ -f github/requirements.txt ]; then pip install -r github/requirements.txt; fi
- name: Validate challenge
run: |
python3 github/challenge_processing_script.py
python3 github/challenge_processing_script.py ${GITHUB_REF#refs/heads/}
env:
IS_VALIDATION: 'True'
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
- name: Create or update challenge
run: |
python3 github/challenge_processing_script.py
python3 github/challenge_processing_script.py ${GITHUB_REF#refs/heads/}
if: ${{github.event_name == 'push' && success()}}
env:
IS_VALIDATION: 'False'
Expand Down
7 changes: 6 additions & 1 deletion github/challenge_processing_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@
zip_file = open(CHALLENGE_ZIP_FILE_PATH, "rb")
file = {"zip_configuration": zip_file}

data = {"GITHUB_REPOSITORY": GITHUB_REPOSITORY}
github_branch = sys.argv[1] if len(sys.argv) > 1 else "challenge"

data = {
"GITHUB_REPOSITORY": GITHUB_REPOSITORY,
"GITHUB_BRANCH": github_branch,
}

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