From e9e8f0fa2c5235e360c974594c76452450e90c31 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 7 Sep 2026 09:16:29 +0200 Subject: [PATCH 1/2] tools: unlabel author ready on base branch conflicts Add a daily workflow that removes the `[author ready]` label from open pull requests conflicting with their base branch and comments with rebase guidance. Signed-off-by: Filip Skokan --- .github/workflows/author-ready-conflicts.yml | 48 ++++++++++++++++++++ doc/contributing/collaborator-guide.md | 1 + 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/author-ready-conflicts.yml diff --git a/.github/workflows/author-ready-conflicts.yml b/.github/workflows/author-ready-conflicts.yml new file mode 100644 index 000000000000..1ffe8132c3a8 --- /dev/null +++ b/.github/workflows/author-ready-conflicts.yml @@ -0,0 +1,48 @@ +name: Unlabel conflicting pull requests + +on: + schedule: + - cron: 15 3 * * * + +permissions: + contents: read + +jobs: + remove-label: + name: Remove author ready + if: github.repository == 'nodejs/node' + runs-on: ubuntu-slim + permissions: + pull-requests: write + steps: + - name: Remove the label and comment + env: + GH_TOKEN: ${{ github.token }} + MESSAGE: >- + This pull request has conflicts with its base branch, removing the + `author ready` label. + + Please + [rebase](https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#step-5-rebase) + your branch onto the latest base branch, resolve the conflicts + locally, and force-push. + + Afterwards the pull request needs a fresh collaborator approval, + and a collaborator will add the label back once it is + [author ready](https://github.com/nodejs/node/blob/HEAD/doc/contributing/collaborator-guide.md#author-ready-pull-requests) + again. + run: | + # Requesting the mergeable field makes GitHub compute the merge state, + # pull requests still reported as UNKNOWN are picked up by a later run. + gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --label 'author ready' \ + --state open \ + --limit 100 \ + --json number,mergeable \ + --jq '.[] | select(.mergeable == "CONFLICTING") | .number' | + while read -r number; do + gh pr edit "$number" --repo "$GITHUB_REPOSITORY" --remove-label 'author ready' + printf '%s\n' "$MESSAGE" | + gh pr comment "$number" --repo "$GITHUB_REPOSITORY" --body-file - + done diff --git a/doc/contributing/collaborator-guide.md b/doc/contributing/collaborator-guide.md index e9dc344dcd38..0a619812d4f5 100644 --- a/doc/contributing/collaborator-guide.md +++ b/doc/contributing/collaborator-guide.md @@ -87,6 +87,7 @@ A pull request is _author ready_ when: * There is a CI run in progress or completed. * There is at least one collaborator approval. * There are no outstanding review comments. +* There are no conflicts with the base branch. Please always add the `author ready` label to the pull request in that case. Please always remove it again as soon as the conditions are not met anymore. From e9542e2b6a3d214497b5c2f2fc4ad808e0ef93ab Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 7 Sep 2026 09:34:14 +0200 Subject: [PATCH 2/2] Update .github/workflows/author-ready-conflicts.yml Co-authored-by: Antoine du Hamel --- .github/workflows/author-ready-conflicts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/author-ready-conflicts.yml b/.github/workflows/author-ready-conflicts.yml index 1ffe8132c3a8..f447c6b80a2e 100644 --- a/.github/workflows/author-ready-conflicts.yml +++ b/.github/workflows/author-ready-conflicts.yml @@ -1,4 +1,4 @@ -name: Unlabel conflicting pull requests +name: Unlabel not-ready pull requests on: schedule: