You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2024/09/16 10:19:59 UTC
(logging-parent) 01/01: Allow GitHub to mark a PR as `merged` not `closed`
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch fix/pr-merge-race-condition
in repository https://gitbox.apache.org/repos/asf/logging-parent.git
commit cf639889f059e90b5b0eec37c9a507296d8453b7
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Mon Sep 16 12:19:50 2024 +0200
Allow GitHub to mark a PR as `merged` not `closed`
We reverse the order of updates to the PR branch and main branch
and allow GitHub time to realize that both branches have the same ref.
This should always mark the PR as "merged", while currently it often
is marked as "closed".
---
.github/workflows/merge-dependabot-reusable.yaml | 6 ++++--
src/changelog/.11.x.x/pr-merge-race-condition.xml | 7 +++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/merge-dependabot-reusable.yaml b/.github/workflows/merge-dependabot-reusable.yaml
index 77beb86..1a02019 100644
--- a/.github/workflows/merge-dependabot-reusable.yaml
+++ b/.github/workflows/merge-dependabot-reusable.yaml
@@ -122,6 +122,8 @@ jobs:
git config user.name "ASF Logging Services RM"
git config user.email private@logging.apache.org
git commit -S -a -m "Update \`$DEPENDENCY_NAME\` to version \`$DEPENDENCY_VERSION\` (#$PR_ID)"
- git push origin
- # Pushing the same commit to the Dependebot branch closes the PR
+ # Pushing the same commit to the Dependabot and main branch closes the PR
git push -f origin "HEAD:$PR_BRANCH"
+ # Allow for GitHub to realize that the PR branch changed
+ sleep 5
+ git push origin
diff --git a/src/changelog/.11.x.x/pr-merge-race-condition.xml b/src/changelog/.11.x.x/pr-merge-race-condition.xml
new file mode 100644
index 0000000..9230e8a
--- /dev/null
+++ b/src/changelog/.11.x.x/pr-merge-race-condition.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="https://logging.apache.org/xml/ns"
+ xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
+ type="fixed">
+ <description format="asciidoc">Fix race condition, which marks merged Dependabot PRs as closed.</description>
+</entry>