From 47cc5995cb93d79cb0f23df63b13b85e97327807 Mon Sep 17 00:00:00 2001 From: Maksym H <1177472+mordamax@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:57:31 +0100 Subject: [PATCH] fix cmd detached commit (#5672) return the repo/ref as .sha creates detached branch and doesn't let to push back the changes --- .github/workflows/cmd.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml index 645b5444aa0f..5498beb50ccb 100644 --- a/.github/workflows/cmd.yml +++ b/.github/workflows/cmd.yml @@ -146,8 +146,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Get command uses: actions-ecosystem/action-regex-match@v2 @@ -333,7 +331,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + repository: ${{ needs.get-pr-branch.outputs.repo }} + ref: ${{ needs.get-pr-branch.outputs.pr-branch }} - name: Install dependencies for bench if: startsWith(steps.get-pr-comment.outputs.group2, 'bench') @@ -360,10 +359,12 @@ jobs: git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git pull --rebase origin ${{ needs.get-pr-branch.outputs.pr-branch }} git add . git restore --staged Cargo.lock # ignore changes in Cargo.lock git commit -m "Update from ${{ github.actor }} running command '${{ steps.get-pr-comment.outputs.group2 }}'" || true + + git pull --rebase origin ${{ needs.get-pr-branch.outputs.pr-branch }} + git push origin ${{ needs.get-pr-branch.outputs.pr-branch }} else echo "Nothing to commit";