Fix branch for PUSH events

- This partially fixes #194
This commit is contained in:
ReenigneArcher
2022-06-17 19:04:43 -04:00
parent 2a13697fef
commit 8509260194
+11 -2
View File
@@ -93,24 +93,30 @@ jobs:
owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' )
repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' )
branch=${GITHUB_HEAD_REF} branch=${GITHUB_HEAD_REF}
commit=${{ github.event.pull_request.head.sha }}
# check the branch variable # check the branch variable
if [ -z "$branch" ] if [ -z "$branch" ]
then then
echo "This is a PUSH event" echo "This is a PUSH event"
branch=${GITHUB_BASE_REF} branch=branch=${{ github.ref_name }}
commit=${{ github.sha }}
else else
echo "This is a PR event" echo "This is a PR event"
fi fi
echo "Owner: ${owner}" echo "Owner: ${owner}"
echo "Repo: ${repo}" echo "Repo: ${repo}"
echo "Branch: ${branch}" echo "Branch: ${branch}"
echo "Commit: ${commit}"
mkdir -p build mkdir -p build
mkdir -p artifacts mkdir -p artifacts
cd build cd build
cmake -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_FLATPAK=ON -DSUNSHINE_CONFIGURE_ONLY=ON .. 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 - name: Build Linux Flatpak
working-directory: build working-directory: build
@@ -361,18 +367,21 @@ jobs:
owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' )
repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' )
branch=${GITHUB_HEAD_REF} branch=${GITHUB_HEAD_REF}
commit=${{ github.event.pull_request.head.sha }}
# check the branch variable # check the branch variable
if [ -z "$branch" ] if [ -z "$branch" ]
then then
echo "This is a PUSH event" echo "This is a PUSH event"
branch=${GITHUB_BASE_REF} branch=branch=${{ github.ref_name }}
commit=${{ github.sha }}
else else
echo "This is a PR event" echo "This is a PR event"
fi fi
echo "Owner: ${owner}" echo "Owner: ${owner}"
echo "Repo: ${repo}" echo "Repo: ${repo}"
echo "Branch: ${branch}" echo "Branch: ${branch}"
echo "Commit: ${commit}"
mkdir build mkdir build
cd build cd build