diff --git a/.github/workflows/pr.yml b/.github/workflows/ci.yml similarity index 92% rename from .github/workflows/pr.yml rename to .github/workflows/ci.yml index 589d181c3..3dfbd66fb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [pull_request] +on: [push] jobs: Macos: @@ -85,25 +85,20 @@ jobs: container: image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-26" steps: + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch - name: Checkout code shell: python run: | - import json from subprocess import check_call from os import environ - with open(environ['GITHUB_EVENT_PATH'], 'r') as f: - content = f.read() - event_data = json.loads(content) - try: - branch_ref = event_data['ref'].split('/')[-1] - except KeyError: - branch_ref = event_data['pull_request']['head']['ref'] - print("Cloning branch", branch_ref) command = [ 'git', 'clone', 'https://github.com/${{github.repository}}', '--depth=1', - '--branch', branch_ref + '--branch', '${{steps.extract_branch.outputs.branch}}' ] check_call(command, cwd=environ['HOME']) - name: Install deps