You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ra...@apache.org on 2026/09/17 05:53:10 UTC

(logging-log4j2) branch fix-port-label-check created (now 03ac2f3d9c)

This is an automated email from the ASF dual-hosted git repository.

ramanathan1504 pushed a change to branch fix-port-label-check
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


      at 03ac2f3d9c Keep `Check port label` from leaving stale blocking checks

This branch includes the following new commits:

     new 03ac2f3d9c Keep `Check port label` from leaving stale blocking checks

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(logging-log4j2) 01/01: Keep `Check port label` from leaving stale blocking checks

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ramanathan1504 pushed a commit to branch fix-port-label-check
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 03ac2f3d9ca976325d82c865266b133ed78c2a1f
Author: Ramanathan <ra...@gmail.com>
AuthorDate: Thu Sep 17 11:22:29 2026 +0530

    Keep `Check port label` from leaving stale blocking checks
---
 .github/workflows/check-port-label.yaml | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/check-port-label.yaml b/.github/workflows/check-port-label.yaml
index f96d6f7d2d..420ba3b6c5 100644
--- a/.github/workflows/check-port-label.yaml
+++ b/.github/workflows/check-port-label.yaml
@@ -36,11 +36,6 @@ on:
       - labeled
       - unlabeled
 
-# Cancel in-progress runs when a newer commit lands on the same PR; pushes to 2.x run to completion.
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
-  cancel-in-progress: true
-
 # Default permissions for each job.
 # Additional permissions should be assigned on a per-job basis.
 permissions: { }
@@ -50,16 +45,26 @@ jobs:
   check-port-label:
     name: "Check port label"
     runs-on: ubuntu-slim
+    permissions:
+      pull-requests: read
     steps:
+      # Every run leaves its own check on the commit, and a cancelled or failed one keeps blocking the merge.
+      # Hence, no `concurrency` cancellation, and labels are read live rather than from the event payload,
+      # so that re-running any earlier run evaluates the labels the PR carries now.
       - name: Require a `port-to-*` or `port-done` label
         env:
-          LABELS: ${{ join(github.event.pull_request.labels.*.name, '\n') }}
+          GH_TOKEN: ${{ github.token }}
+          REPO: ${{ github.repository }}
+          PR_NUMBER: ${{ github.event.pull_request.number }}
           AUTHOR: ${{ github.event.pull_request.user.login }}
         shell: bash
         run: |
           if [ "$AUTHOR" = 'dependabot[bot]' ]; then
             echo "Dependabot PR, no port label required."
-          elif printf '%b\n' "$LABELS" | grep -qE '^(port-to-.+|port-done)$'; then
+            exit 0
+          fi
+          labels=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json labels --jq '.labels[].name')
+          if grep -qE '^(port-to-.+|port-done)$' <<< "$labels"; then
             echo "Port label found."
           else
             echo "::error::Add a \`port-to-<branch>\` label if this change must be ported to another branch, or \`port-done\` if no port is needed. See https://github.com/apache/logging-log4j2/issues/3161"