Attempt to get the correct PR commit hash (#10900)

* Attempt to get the correct PR commit hash

* Add commit hash to flatpak

* Use given hash if `git_commit_hash` env variable is present
This commit is contained in:
Noisyfox
2025-10-11 21:37:46 +08:00
committed by GitHub
parent ad0ed95b85
commit abe3cd48f9
3 changed files with 30 additions and 8 deletions

View File

@@ -97,12 +97,15 @@ jobs:
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
git_commit_hash="${{ github.event.pull_request.head.sha }}"
else
ver=V$ver_pure
git_commit_hash=""
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
shell: bash
- uses: flathub-infra/flatpak-github-actions/flatpak-builder@master
with: