Skip to content

Commit

Permalink
Update CI GitHub workflow
Browse files Browse the repository at this point in the history
Allow PRs to checkout non develop branch from core Alaveteli. This is
useful for PRs which depend on core changes in order to work.
  • Loading branch information
gbp committed Oct 26, 2023
1 parent eb00147 commit 39228dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,29 @@ jobs:
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/alaveteli_test
RAILS_ENV: test
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Extract associated required Alaveteli PR number
id: pr_alaveteli_number
run: |
PR_DESCRIPTION=$(gh pr view https://github.com/mysociety/whatdotheyknow-theme/pull/${{ github.event.pull_request.number }} --json body -q '.body')
echo "PR_ALAVETELI_NUMBER=$(echo $PR_DESCRIPTION | grep -o 'https://github.com/mysociety/alaveteli/pull/[0-9]*' | grep -o '[0-9]*$')" >> $GITHUB_ENV
- name: Get Alaveteli branch name
id: pr_alaveteli_branch
run: |
if [[ ! -z "$PR_ALAVETELI_NUMBER" ]]; then
echo "PR_ALAVETELI_BRANCH=$(gh pr view https://github.com/mysociety/alaveteli/pull/$PR_ALAVETELI_NUMBER --json headRefName -q '.headRefName')" >> $GITHUB_ENV
else
echo "PR_ALAVETELI_BRANCH=develop" >> $GITHUB_ENV
fi
- name: Checkout Alaveteli
uses: actions/checkout@v2
with:
repository: mysociety/alaveteli
ref: develop
ref: ${{ env.PR_ALAVETELI_BRANCH }}
path: core
submodules: true
fetch-depth: 0
Expand Down

0 comments on commit 39228dd

Please sign in to comment.