From 217abdf97aa41dc1865421e276691de50bc6d4a4 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Wed, 7 Aug 2024 14:15:18 +0200 Subject: [PATCH] chore: CI: fix rebase command --- .github/workflows/rebase-on-comment.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rebase-on-comment.yml b/.github/workflows/rebase-on-comment.yml index 03d7f5e483..f995bf681d 100644 --- a/.github/workflows/rebase-on-comment.yml +++ b/.github/workflows/rebase-on-comment.yml @@ -12,18 +12,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head - name: Rebase PR branch onto base branch env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - PR_NUMBER=${{ github.event.issue.number }} - API_URL="https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" - PR_DETAILS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" $API_URL) - - BASE_REF=$(echo $PR_DETAILS | jq -r .base.ref) - HEAD_REF=$(echo $PR_DETAILS | jq -r .head.ref) - - git checkout $HEAD_REF - git fetch origin $BASE_REF - git rebase origin/$BASE_REF + git fetch origin refs/pull/${{ github.event.issue.number }}/base + git rebase FETCH_HEAD git push --force-with-lease \ No newline at end of file