You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: suggest force pushing to update pull requests
Add a callout tip to the bot's comment to guide new contributors away
from closing pull requests to make corrections.
Suggest modifying existing commits and updating the branch using git
push --force (or git push --force-with-lease) instead.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ Some configuration keys offer advanced options:
105
105
*`check_patch_headers`: Can be `true` (default, hard error), `"warning"` (non-blocking), or `false` to disable.
106
106
*`check_trailing_newline`: Can be `true` (default, hard error), `"warning"` (non-blocking), or `false` to disable.
107
107
*`check_pkg_release`: Can be `"warning"`, `"error"`, or `false` to disable.
108
+
*`show_force_push_tip`: Set to `true` (default) to append a helpful tip regarding how to correct validation errors using force-pushing. Set to `false` to disable.
108
109
*`enable_stale_bot`: Set to `true` to enable the stale PR bot cleanup for this repository. Defaults to `false` (opt-in).
109
110
110
111
Here is a comprehensive example containing all available toggle options:
@@ -118,6 +119,7 @@ Here is a comprehensive example containing all available toggle options:
Copy file name to clipboardExpand all lines: cloudflare-worker/src/index.js
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -613,6 +613,11 @@ async function handleWebhook(request, env) {
613
613
});
614
614
}
615
615
616
+
if(!allPassed&&CONFIG.show_force_push_tip){
617
+
commentBody+="> [!TIP]\n";
618
+
commentBody+="> **Do not close this pull request** to make corrections. Instead, modify your existing commits (e.g. `git commit --amend`) and update the branch using `git push --force-with-lease --force-if-includes`. The checks will re-run automatically.\n\n";
619
+
}
620
+
616
621
// Add feedback link & version footer
617
622
letfooterMd=`\n\n---\n<sub>Something broken? Consider [reporting an issue](https://github.com/openwrt/openwrt-bot-worker/issues/new).</sub>`;
0 commit comments