From 2dfcd0f842f40d97ee16b4ba20a121e3fea17250 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 8 Jun 2022 19:36:21 -0400 Subject: [PATCH] workflows: add stamp file in openshift/os to ensure we push rebases The create-pull-request action currently only force-pushes branches if their diff has changed. However, if we've meanwhile landed a parallel fedora-coreos-config update PR via a different branch, the diff might be the same but the base commit will be different. We need to push the branch in this case too, or else the PR will be left unmergeable due to conflicts. As a workaround, write the base commit ID into a stamp file in the root of openshift/os, so the diff will change whenever the base does. --- .github/workflows/openshift-os.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/openshift-os.yml b/.github/workflows/openshift-os.yml index 8d655ecc..ff19cf6a 100644 --- a/.github/workflows/openshift-os.yml +++ b/.github/workflows/openshift-os.yml @@ -53,7 +53,14 @@ jobs: echo "No non-trivial changes; exiting" exit 0 fi + + base=$(git rev-parse HEAD) git checkout testing-devel + # Hack: update a stamp to force create-pull-request to update the + # branch, even if we're just rebasing on a previous manual + # fedora-coreos-config sync + # https://github.com/peter-evans/create-pull-request/issues/1191 + echo $base > ../.fedora-coreos-config-base marker=OPENSHIFT-OS-END-OF-LOG-MARKER-$RANDOM$RANDOM$RANDOM cat >> $GITHUB_ENV <