From 523f71d6eb34a075c2ded8fdd67c90bc9c25c093 Mon Sep 17 00:00:00 2001 From: Vladisvell Date: Sun, 22 Dec 2024 21:45:36 +0500 Subject: [PATCH] rebuild tgui only if there is difference between starting and ending point --- .github/workflows/testmerge.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testmerge.yml b/.github/workflows/testmerge.yml index d533fd49b67..4df30e6a824 100644 --- a/.github/workflows/testmerge.yml +++ b/.github/workflows/testmerge.yml @@ -11,7 +11,7 @@ on: type: boolean required: true default: false - + env: BASE_BRANCH: master220 TESTMERGE_BRANCH: testmerge @@ -109,6 +109,7 @@ jobs: git config --local user.name "Testmerge Worker" git switch ${{ env.TESTMERGE_BRANCH }} || git switch -c ${{ env.TESTMERGE_BRANCH }} git reset --hard ${{ env.BASE_BRANCH }} + PRE_TESTMERGE_SHA=$(git rev-parse HEAD) ./tools/hooks/install.sh ./tgui/bin/tgui --install-git-hooks @@ -158,28 +159,30 @@ jobs: git config --local user.name "Changelog Generation" git commit -m "Automatic changelog generation" fi - + # Generate TGUI bundle - ./tgui/bin/tgui - CHANGES=$(git diff | wc -l) + POST_TESTMERGE_SHA=$(git rev-parse HEAD) + CHANGES=$(git diff $POST_TESTMERGE_SHA $PRE_TESTMERGE_SHA ./tgui | wc -l) + if [ "$CHANGES" -gt 0 ] ; then + ./tgui/bin/tgui git config --local user.email "action@github.com" git config --local user.name "TGUI bundle Generation" git commit -am "Testmerge TGUI bundle build generation" fi - + git push -f origin ${{ env.TESTMERGE_BRANCH }} - + if [ ${{ inputs.apply_to_stable }} ] ; then git fetch origin ${{ env.STABLE_BRANCH }} git push -f --set-upstream origin ${{ env.TESTMERGE_BRANCH }}:${{ env.STABLE_BRANCH}} fi - + # Output the list of merged PRs echo "${MERGED_PRS[@]}" echo "merged_prs=${MERGED_PRS[@]}" >> $GITHUB_OUTPUT echo "END" - + #- name: Comment on merged PRs # uses: actions/github-script@v7 # with: