From f3c515f93f98142b4e5e8cbc8d3d89aec293d7ad Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Wed, 14 Jul 2021 16:32:40 +0200 Subject: [PATCH 1/2] Allow testing specific PR in Actions workflow --- .github/workflows/tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ca662bab..6aad7402 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,6 +7,10 @@ on: - '[0-9]+\.[0-9]+' pull_request: workflow_dispatch: + inputs: + pr: + description: 'PR number in mautic/mautic to test against' + required: false schedule: # Run every day at 10 AM UTC to discover potential issues with recent changes to Mautic itself - cron: '0 10 * * *' @@ -73,8 +77,14 @@ jobs: composer validate --strict composer install --prefer-dist --no-progress - - name: Clone Mautic features branch from GitHub - run: git clone -b features --single-branch --depth 1 https://github.com/mautic/mautic.git mautic + - name: Clone Mautic features or specific PR from GitHub + run: | + gh repo clone mautic/mautic -- --branch features --single-branch --depth 1 + if [[ "${{ github.event.inputs.pr }}" != "" ]]; then + pushd mautic + gh pr checkout ${{ github.event.inputs.pr }} + popd + fi - name: Move files to web root run: | From 5019c0098f3da136bd0eade207f46e579e1c6b6b Mon Sep 17 00:00:00 2001 From: Dennis Ameling Date: Wed, 14 Jul 2021 16:40:00 +0200 Subject: [PATCH 2/2] Add GH token to workflow --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6aad7402..a0e0e00d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,6 +85,8 @@ jobs: gh pr checkout ${{ github.event.inputs.pr }} popd fi + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - name: Move files to web root run: |