Skip to content

chore(workflows): add auto-labeler step to release draft workflow#2763

Merged
tusharmath merged 2 commits intomainfrom
auto-label
Apr 1, 2026
Merged

chore(workflows): add auto-labeler step to release draft workflow#2763
tusharmath merged 2 commits intomainfrom
auto-label

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Apr 1, 2026

Summary

Add an auto-labeler step to the release-drafter workflow so that PRs are automatically labeled based on rules defined in release-drafter.yml.

Context

The release-drafter workflow previously only updated the release draft on pushes to main. PRs were not being automatically labeled, requiring manual label assignment before merging. The release-drafter action supports an autolabeler sub-action that reads label rules from the same config file and applies them to PRs on pull_request_target events.

Changes

  • Added an "Auto Labeler" step to .github/workflows/release-drafter.yml that runs on pull_request_target events using release-drafter/autolabeler@v7
  • Updated draft_release_update_job.rs in the forge_ci crate to include the corresponding auto-labeler step in the programmatically-generated workflow job

Key Implementation Details

The auto-labeler step is gated with if: github.event_name == 'pull_request_target' so it only fires for PR events and not for push events (which trigger the release draft update). Both the hand-authored YAML and the Rust-generated workflow are kept in sync.

Testing

# Verify the generated workflow matches the committed YAML
cargo insta test --accept -p forge_ci

# Manually open a PR against main and confirm labels are applied automatically
# based on the rules in .github/release-drafter.yml

@tusharmath tusharmath enabled auto-merge (squash) April 1, 2026 10:43
@tusharmath tusharmath changed the title auto label chore(workflows): add auto-labeler step to release draft workflow Apr 1, 2026
@tusharmath tusharmath merged commit 4beaccd into main Apr 1, 2026
10 checks passed
@tusharmath tusharmath deleted the auto-label branch April 1, 2026 10:46
@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore Routine tasks like conversions, reorganization, and maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant