From 606394630aebe409b3c22b42ffd007ad9fa6e09d Mon Sep 17 00:00:00 2001 From: Yiming Luo Date: Fri, 17 Jan 2025 16:12:56 -0500 Subject: [PATCH] Fix upgrade.yml workflow --- .github/workflows/upgrade.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade.yml index 3a8b60d5..3c4e770a 100644 --- a/.github/workflows/upgrade.yml +++ b/.github/workflows/upgrade.yml @@ -5,6 +5,7 @@ on: workflow_dispatch: {} schedule: - cron: 0 0 * * * + jobs: upgrade: name: Upgrade @@ -19,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 14.15.0 + node-version: 18.18.0 - name: Install dependencies run: yarn install --check-files --frozen-lockfile - name: Upgrade dependencies @@ -27,15 +28,29 @@ jobs: - name: Find mutations id: create_patch run: |- + pwd + echo "Checking for staged changes..." + git status git add . - git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT - working-directory: ./ + + echo "Generating patch file..." + git diff --staged --patch --exit-code > yiming_test_patch || { + echo "Staged changes detected. Patch file created." + echo "patch_created=true" >> $GITHUB_OUTPUT + } + + ls -la + - name: Verify patch file before upload + run: |- + pwd + ls -la + echo ${{ github.workspace }} - name: Upload patch if: steps.create_patch.outputs.patch_created uses: actions/upload-artifact@v4 with: - name: .repo.patch - path: .repo.patch + name: yiming_test_patch + path: ${{ github.workspace }}/yiming_test_patch overwrite: true pr: name: Create Pull Request @@ -50,10 +65,10 @@ jobs: - name: Download patch uses: actions/download-artifact@v4 with: - name: .repo.patch + name: yiming_test_patch path: ${{ runner.temp }} - name: Apply patch - run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + run: '[ -s ${{ runner.temp }}/yiming_test_patch ] && git apply ${{ runner.temp }}/yiming_test_patch || echo "Empty patch. Skipping."' - name: Set git identity run: |- git config user.name "github-actions"