janhoy commented on code in PR #4941:
URL: https://github.com/apache/solr/pull/4941#discussion_r4087985090


##########
.github/workflows/changelog-comment-command.yml:
##########
@@ -0,0 +1,153 @@
+name: Changelog Comment Commands
+
+# Lets a PR author (or any committer) toggle the 'no-changelog' label by
+# commenting on the PR, without needing the repo write access that setting a
+# label directly requires:
+#
+#   /no-changelog     - mark the PR as not needing a changelog entry
+#   /needs-changelog  - undo that
+#
+# The command applies/removes the label, and the label change re-triggers the
+# "Validate Changelog" workflow (which listens for labeled/unlabeled events),
+# so the red check turns green on its own.
+#
+# This workflow deliberately never checks out or executes PR code: it only
+# reads the comment payload and calls the labels API, so running with a
+# write-scoped token is safe.
+on:
+  issue_comment:
+    types:
+      - created
+
+concurrency:
+  group: changelog-comment-command-${{ github.event.issue.number }}
+
+permissions:
+  issues: write        # add/remove labels, add a reaction, post a reply
+  pull-requests: write
+
+jobs:
+  handle-command:

Review Comment:
   Yes. We could have dispatched to an external "bot" (py script) to do the 
business logic. But that script would probably be 150 lines as well and would 
need to acquire a token etc. So guess this is the way to go.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to