From 850926019436dcf21e8526db0adad3f1b5d75000 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 17 Jun 2022 19:04:43 -0400 Subject: [PATCH] Fix branch for PUSH events - This partially fixes #194 --- .github/workflows/CI.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 34d1c7c3d30..b25b7353b52 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -93,24 +93,30 @@ jobs: owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) branch=${GITHUB_HEAD_REF} + commit=${{ github.event.pull_request.head.sha }} # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" - branch=${GITHUB_BASE_REF} + branch=branch=${{ github.ref_name }} + commit=${{ github.sha }} else echo "This is a PR event" fi echo "Owner: ${owner}" echo "Repo: ${repo}" echo "Branch: ${branch}" + echo "Commit: ${commit}" mkdir -p build mkdir -p artifacts cd build cmake -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_FLATPAK=ON -DSUNSHINE_CONFIGURE_ONLY=ON .. + + # add the commit + echo " commit: ${commit}" >> ./com.github.sunshinestream.sunshine.yml - name: Build Linux Flatpak working-directory: build @@ -361,18 +367,21 @@ jobs: owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) branch=${GITHUB_HEAD_REF} + commit=${{ github.event.pull_request.head.sha }} # check the branch variable if [ -z "$branch" ] then echo "This is a PUSH event" - branch=${GITHUB_BASE_REF} + branch=branch=${{ github.ref_name }} + commit=${{ github.sha }} else echo "This is a PR event" fi echo "Owner: ${owner}" echo "Repo: ${repo}" echo "Branch: ${branch}" + echo "Commit: ${commit}" mkdir build cd build