Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use GITHUB_REF if GITHUB_HEAD_REF doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jun 10, 2021
1 parent 2df7196 commit 2541863
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,16 @@ jobs:
# Attempt to check out the same branch of Complement as the PR. If it
# doesn't exist, fallback to master.
- name: Checkout complement
shell: bash
run: |
# For pull requests we want to use GITHUB_HEAD_REF (the pull request
# head branch). Otherwise, we use GITHUB_REF (refs/heads/<branch>).
BRANCH_NAME="$GITHUB_HEAD_REF"
if [[ -z "$BRANCH_NAME" ]]; then
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
fi
mkdir -p complement
(wget -O - https://github.com/matrix-org/complement/archive/$GITHUB_HEAD_REF.tar.gz || wget -O - https://github.com/matrix-org/complement/archive/master.tar.gz) | tar -xz --strip-components=1 -C complement
(wget -O - https://github.com/matrix-org/complement/archive/$BRANCH_NAME.tar.gz || wget -O - https://github.com/matrix-org/complement/archive/master.tar.gz) | tar -xz --strip-components=1 -C complement
# Build initial Synapse image
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
Expand Down

0 comments on commit 2541863

Please sign in to comment.