create-pull-request icon indicating copy to clipboard operation
create-pull-request copied to clipboard

Autosync PR out of date

Open paymog opened this issue 1 year ago • 2 comments
trafficstars

Subject of the issue

I'm following the pattern for the auto-sync PR to keep my prod branch up to date with my dev branch. I just merged one of these PRs. then I pushed another commit to dev, the new PR was created, but I see that it's out of date

image

Here's my workflow

name: Auto PR from dev to prod

on:
  push:
    branches:
      - dev

jobs:
  check-and-create-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: prod
      - name: Reset promotion branch
        run: |
          git fetch origin dev:dev
          git reset --hard dev
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          branch: prod-promotion
          delete-branch: true
          title: "Auto PR: Merge changes from dev to prod"
          body: "This pull request has been automatically created to merge changes from the dev branch into the prod branch."

paymog avatar Aug 09 '24 15:08 paymog

What's interesting is that the single commit in the list is correct and as expected. Is github complaining that the merge commit in prod is not present in prod-promotion?

paymog avatar Aug 09 '24 15:08 paymog

Hi @paymog

I'm not really sure. It might be possible to "reset" by recreating the dev branch on the HEAD of prod and trying again.

Or you could click to update the branch and see what gets merged in. It might give a clue to what the issue is.

peter-evans avatar Aug 12 '24 08:08 peter-evans