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

ppkarwasz pushed a commit to branch feat/gha/no-draft-mode
in repository https://gitbox.apache.org/repos/asf/logging-parent.git

commit 42ea5bbd45995510da392b27cd8e88cdf06dbb57
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri Jul 24 11:45:11 2026 +0200

    Don't switch to "Draft mode"
    
    Since GitHub's June 11, 2026 change "Bot-created pull requests can run
    workflows if approved"[1], workflows triggered by the "Process Dependabot
    PR" push are no longer silently dropped, but created in an
    approval-required state. A maintainer can start the required build checks
    with the "Approve workflows to run" button, so parking the PR in draft
    mode is no longer necessary.
    
    Also drop the `pull-requests: write` permission, which was only needed to
    toggle draft mode, and explicitly opt into `persist-credentials` for the
    checkout, since the changelog commit push relies on it.
    
    [1] 
https://github.blog/changelog/2026-06-11-bot-created-pull-requests-can-run-workflows-if-approved/
    
    Assisted-By: Claude Fable 5 <[email protected]>
---
 .github/workflows/process-dependabot-reusable.yaml | 23 ++--------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/process-dependabot-reusable.yaml 
b/.github/workflows/process-dependabot-reusable.yaml
index 5de0638..c85755c 100644
--- a/.github/workflows/process-dependabot-reusable.yaml
+++ b/.github/workflows/process-dependabot-reusable.yaml
@@ -43,8 +43,6 @@ jobs:
     permissions:
       # Push changelog commit
       contents: write
-      # Switch PR into draft mode
-      pull-requests: write
 
     steps:
 
@@ -79,6 +77,8 @@ jobs:
         uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0
         with:
           ref: ${{ steps.pr.outputs.head-ref }}
+          # The credentials will be used in the "Add & commit changes" step
+          persist-credentials: true
           # An action triggered by `workflow_run` has access to secrets.
           # Checking out untrusted code requires an explicit opt-in.
           allow-unsafe-pr-checkout: true
@@ -141,22 +141,3 @@ jobs:
             git commit -m "Generate changelog entries for #$PR_ID"
             git push origin "HEAD:${HEAD_REF}"
           fi
-
-      # Pushes made with the default `GITHUB_TOKEN` do not trigger workflows 
(GitHub anti-recursion rule),
-      # so the required checks will not re-run against the changelog commit 
pushed above.
-      # Introducing a PAT is undesirable, so we park the PR in draft mode 
instead.
-      # A maintainer must then:
-      #   1. Approve the PR.
-      #   2. Mark the PR as “Ready for review”, this fires `ready_for_review`,
-      #      which runs CI against the changelog commit.
-      #   3. Enable “auto-merge”.
-      - name: Switch PR into draft mode
-        shell: bash
-        env:
-          GH_TOKEN: ${{ github.token }}
-          PR_ID: ${{ steps.pr.outputs.id }}
-        run: |
-          is_draft=$(gh pr view "$PR_ID" --json isDraft -q .isDraft)
-          if [ "$is_draft" = "false" ]; then
-            gh pr ready --undo "$PR_ID"
-          fi

Reply via email to