From 02b65eea86a001d68ac0e5a4c0916023c560c652 Mon Sep 17 00:00:00 2001 From: heinu <118418714+heinu123@users.noreply.github.com> Date: Sat, 2 Dec 2023 12:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpull=5Frequest=E6=97=B6?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=AF=BB=E5=8F=96commit=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index f4588a99e9..465d80c872 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -57,7 +57,7 @@ jobs: echo "### Build Success" >> $GITHUB_STEP_SUMMARY echo "|Artifact|SHA256|" >> $GITHUB_STEP_SUMMARY echo "|:--------:|:----------|" >> $GITHUB_STEP_SUMMARY - canary=($(sha256sum '${{ env.APK_FILE_CANARY }}')) + canary=$(sha256sum "${{ env.APK_FILE_CANARY }}") echo "SHA256=$canary" >> $GITHUB_ENV echo "|Canary|$canary" >> $GITHUB_STEP_SUMMARY @@ -70,10 +70,14 @@ jobs: - name: commit run: | - mkdir -p ${{ github.workspace }}/git_clone - git clone ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }} - cd ${{ github.workspace }}/git_clone - echo "commit=$(git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:'%h %s')" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "commit=${{ github.event.head_commit.message }}" >> $GITHUB_ENV + else + mkdir -p ${{ github.workspace }}/git_clone + git clone ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }} + cd ${{ github.workspace }}/git_clone + echo "commit=$(git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:'%h %s')" >> $GITHUB_ENV + fi - name: Post to Canary Channel if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.ref_type != 'tag' && contains(github.event.head_commit.message, '[skip post]') == false && contains(github.event.head_commit.message, 's#') == false }}