Skip to content

Conversation

@ElanHasson
Copy link
Contributor

Summary

  • Fix release-drafter v6 failing silently on pull_request events due to invalid GraphQL query
  • Remove duplicate pull_request trigger (keep only pull_request_target)
  • Add disable-releaser condition to only run autolabeler on PR events

Root Cause

The release-drafter action was using refs/pull/XX/merge as targetCommitish in GraphQL queries, which returns null for object(expression:), causing the "Data doesn't contain nodes field" error.

Test plan

  • Verify autolabeler still works on PRs
  • Verify release drafting works on push to main

🤖 Generated with Claude Code

The release-drafter v6 action was failing silently on pull_request events
because it tried to query commit history using `refs/pull/XX/merge` as the
target commitish, which the GraphQL API cannot resolve.

Changes:
- Remove duplicate `pull_request` event (keep only `pull_request_target`)
- Add `disable-releaser` condition to skip release drafting on PR events

Now:
- push to main: Full release drafting runs
- pull_request_target: Only autolabeler runs (no GraphQL query failure)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added the bug Something isn't working label Dec 21, 2025
@claude
Copy link

claude bot commented Dec 21, 2025

Claude finished @ElanHasson's task —— View job


PR Review: Fix release-drafter silent failure

Review Checklist

  • Read and analyze the modified workflow file
  • Evaluate code quality and best practices
  • Check for potential bugs or issues
  • Assess performance considerations
  • Review security concerns
  • Evaluate test coverage implications

Overall Assessment ✅

This is a well-implemented fix that addresses a real issue with release-drafter v6. The changes are minimal, targeted, and follow GitHub Actions best practices.

Code Quality & Best Practices ⭐

Excellent implementation with the following strengths:

  1. Clean trigger separation: Removing the duplicate pull_request trigger eliminates confusion and potential race conditions
  2. Conditional logic: Using disable-releaser: ${{ github.event_name == 'pull_request_target' }} is elegant and self-documenting
  3. Clear documentation: The inline comments explain the behavior clearly (.github/workflows/release-drafter.yml:23-24)
  4. Minimal change principle: Only modified what was necessary to fix the issue

Technical Analysis 🔍

✅ Root Cause Accurately Identified

The GraphQL query issue with refs/pull/XX/merge is a known limitation in release-drafter v6. This ref doesn't exist as a proper Git object, causing the object(expression:) query to return null.

✅ Solution is Correct

  • Before: Had both pull_request AND pull_request_target triggers (redundant and problematic)
  • After: Only uses pull_request_target with conditional disable-releaser
  • Result: Autolabeler runs on PRs, release drafting only on push to main

Security Considerations 🔒

No security concerns identified:

  1. pull_request_target is used appropriately (necessary for autolabeler to work with forks)
  2. ✅ Permissions remain properly scoped (contents: read at workflow level, elevated only for the job)
  3. ✅ No new secrets or tokens introduced
  4. ✅ Configuration file is properly referenced and secured

Performance & Efficiency 📈

Improvements achieved:

  1. Reduced workflow runs: Eliminates duplicate triggers on PR events
  2. Faster PR processing: Skips unnecessary release drafting on PRs
  3. Clear separation of concerns: Autolabeling vs. release drafting

Potential Issues & Recommendations 🔧

Minor Considerations:

  1. No breaking changes detected - existing functionality preserved
  2. Autolabeler config looks comprehensive - good coverage of file patterns and branch naming
  3. Consider monitoring: Watch the first few PRs to ensure autolabeling works as expected

Suggested Test Validation:

Based on your test plan, you should verify:

  • Open a test PR and confirm labels are automatically applied
  • Push to main and verify release draft is created/updated
  • Check that no errors appear in the Actions logs

Dependencies & Configuration ✅

The release-drafter configuration (.github/release-drafter.yml) is well-structured with:

  • Comprehensive autolabeler rules covering branch patterns and file changes
  • Good categorization for changelog generation
  • Proper version resolution strategy

Summary

This is a high-quality fix that solves a real problem with minimal impact. The implementation follows GitHub Actions best practices and maintains backward compatibility while fixing the silent failure issue.

Recommendation: ✅ Approve and merge after verifying the test plan items.


@ElanHasson ElanHasson merged commit 48a066a into main Dec 21, 2025
8 checks passed
@ElanHasson ElanHasson deleted the fix/release-drafter-silent-failure branch December 21, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants