`This branch is out-of-date with the base branch` - warning from github
Here's my workflow
name: Auto PR from dev to prod
on:
push:
branches:
- dev
jobs:
check-and-create-pr:
runs-on: blacksmith-2vcpu-ubuntu-2204
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."
I'm using this on a terraform repo. The idea is that when a developer merges into the dev branch, a new PR is opened to merge into the prod branch. It overall works great, but when the auto PR is opened, I see the following from github which then affects our ability to merge without triggering an audit log
Whats the correct way to avoid this issue?
Hi @paymog
In my experience that GitHub message just means that some other commit landed in prod after the prod-promotion branch was created. Presumably, you have a rule set on the repository to make sure that all pull requests are up-to-date before merging. So the resolution would be to click Update branch, wait for the checks to pass, and then merge.
Am I misunderstanding the situation?