From 2d5159e05f6ab5635568bb94872c2c85402d2a82 Mon Sep 17 00:00:00 2001 From: Xikaro <0regon.end@gmail.com> Date: Sun, 22 Dec 2024 22:33:38 +0500 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2873c3d44..83a03240f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main concurrency: group: ${{ github.workflow }} @@ -72,28 +69,25 @@ jobs: id: check_pakku_lock_prev shell: bash run: | - if ! git ls-tree -r ${{ steps.latest_tag.outputs.tag }} -- ./pakku-lock.json &> /dev/null; then - echo "❌ File pakku-lock.json not found in previous tag" - else + if git cat-file -e ${{ steps.latest_tag.outputs.tag }}:./pakku-lock.json 2>/dev/null; then echo "✔️ File pakku-lock.json found in previous tag" + echo "file_found=true" >> $GITHUB_OUTPUT + else + echo "❌ File pakku-lock.json not found in previous tag" + echo "file_found=false" >> $GITHUB_OUTPUT fi - name: 📁 Check and copy pakku-lock.json from previous tag id: check_copy_lock + if: steps.check_pakku_lock_prev.outputs.file_found == 'true' shell: bash run: | git show tags/${{ steps.latest_tag.outputs.tag }}:./pakku-lock.json > ./pakku-lock-prev.json if [ -s ./pakku-lock-prev.json ]; then echo "✔️ File pakku-lock-prev.json created" else - echo "❌ Error: File pakku-lock-prev.json is empty or not created" - echo "Creating pakku-lock-prev.json from current repository file" - cp ./pakku-lock.json ./pakku-lock-prev.json - if [ -s ./pakku-lock-prev.json ]; then - echo "✔️ File pakku-lock-prev.json created from current repository file" - else - echo "❌ Error: Failed to create pakku-lock-prev.json from current repository file" - fi + echo "❌ Error: File pakku-lock-prev.json is empty or not created" && exit 1 + fi fi - name: 📦 Download pakku.jar