Add GitHub workflows for automatic PR labeling for needs-review and needs-changes#1974
Add GitHub workflows for automatic PR labeling for needs-review and needs-changes#1974memodi wants to merge 12 commits intonetobserv:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/needs-review |
|
/hold |
|
/needs-changes |
|
Hi @jotak - I need some help with this, I am always facing 403 error with log, do I need some kind of permissions with new github workflows, based on what I read it should always run with |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1974 +/- ##
==========================================
- Coverage 71.79% 71.69% -0.11%
==========================================
Files 80 80
Lines 10733 10733
==========================================
- Hits 7706 7695 -11
- Misses 2622 2629 +7
- Partials 405 409 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/needs-review |
|
/needs-changes |
|
/needs-review |
|
/needs-review |
|
/needs-review |
|
/needs-review |
- Add needs-review workflow: automatically labels non-draft PRs without WIP in title (excludes red-hat-konflux) - Add needs-changes workflow: manages review status labels based on PR reviews and comments - Removes needs-review when any review is submitted - Adds needs-changes for non-approved reviews - Removes needs-changes when lgtm label is added - Allows manual needs-changes labeling via comments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Allow users to manually add needs-review label by commenting "needs-review" or "/needs-review" on PRs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add explicit permissions for issues and pull-requests write access to resolve "Resource not accessible by integration" errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Convert both workflow files to use gh CLI instead of actions/github-script for label management: - needs-review.yaml: Use gh pr edit for adding/removing needs-review labels - needs-changes.yaml: Use gh pr edit for managing needs-changes labels based on review state 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace actions/checkout with GH_REPO environment variable to avoid "fatal: not a git repository" errors. This approach matches the existing pr-labels.yaml workflow and is more efficient. Changes: - Remove actions/checkout@v4 steps from all jobs - Replace GITHUB_TOKEN with GH_TOKEN - Add GH_REPO environment variable for repository context 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove restrictive fork condition that was causing steps to be skipped - Add comprehensive debugging output to diagnose event and condition issues - Make PR condition more explicit with != null check - Ensure proper permissions are set on all jobs This should resolve: 1. needs-changes.yaml steps being skipped 2. needs-review.yaml not executing on "/needs-review" comments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
87313bb to
db7bc88
Compare
Summary
Changes
needs-review.yaml: Automatically adds "needs-review" label to non-draft PRs (excludes red-hat-konflux author and WIP titles)
needs-changes.yaml: Manages review status labels:
I performed self-review of the code changes - Mehul Modi
Test plan
🤖 Generated with Claude Code