From 16197afc9532214e1132495cc508296914d19e2a Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 26 Jun 2022 19:48:22 +0200 Subject: [PATCH 1/3] CI triggered on pull_request event --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 668a5519..5d5240a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: [push] +on: + push: + branches: + - master + pull_request: jobs: Macos: From 6891ce3b576c550d29e3fd2a77b8b3fb5c79d372 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 26 Jun 2022 19:53:49 +0200 Subject: [PATCH 2/3] Use actions/checkout@v2 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d5240a8..9dcd3b3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Setup python 3.10 uses: actions/setup-python@v2 with: @@ -99,7 +99,7 @@ jobs: 'git', 'clone', 'https://github.com/${{github.repository}}', '--depth=1', - '--branch', '${{steps.extract_branch.outputs.branch}}' + '--branch', ${{steps.extract_branch.outputs.branch}}' ] check_call(command, cwd=environ['HOME']) - name: Install deps From b69bf4d062cdbc0b45a1b587502c18e3b8ca3335 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Sun, 26 Jun 2022 20:25:02 +0200 Subject: [PATCH 3/3] Simplify branch retrieval --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9dcd3b3a..24c95e58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,10 +86,6 @@ jobs: container: image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-31" 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: | @@ -99,7 +95,7 @@ jobs: 'git', 'clone', 'https://github.com/${{github.repository}}', '--depth=1', - '--branch', ${{steps.extract_branch.outputs.branch}}' + '--branch', '${{ github.head_ref || github.ref_name }}' ] check_call(command, cwd=environ['HOME']) - name: Install deps