gitlab-update-mr

Push the current branch and refresh its GitLab merge request body.

1|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/hadenlabs/tasks --skill gitlab-update-mr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitlab-update-mr
Source: https://github.com/hadenlabs/tasks/tree/main/.claude/skills/gitlab-update-mr
Command: npx skills add https://github.com/hadenlabs/tasks --skill gitlab-update-mr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Push the current branch, detect the associated GitLab merge request, and safely refresh the MR body to reflect the latest changes.

Core Features & Use Cases

  • Validate changes locally.
  • Push the current branch (handles unset upstreams).
  • Detect the MR for the current branch.
  • Regenerate the PR body from .gitlab/merge_request_templates/MERGE_REQUEST_TEMPLATE.md using the latest diff.
  • Update the MR body with glab mr update or via the glab api fallback.
  • Use case: keep MR descriptions in sync before merging.

Quick Start

On a feature branch with a corresponding MR, run the skill to refresh the MR description.

Frequently Asked Questions about gitlab-update-mr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep a GitLab merge request description in sync with my latest commits?

To keep a GitLab merge request description in sync, push the current branch, detect the associated MR, and regenerate its body from a merge request template reflecting the latest diff. This ensures the description accurately tracks recent commits before merging.

What is the best way to automatically update a GitLab MR body when pushing a branch?

The best way to automatically update a GitLab MR body when pushing a branch is using a workflow that detects the open MR and regenerates the description from a predefined markdown template. It safely applies the update via glab or the GitLab API.

Can I use a merge request template to regenerate a GitLab MR description from a diff?

Yes, you can use a merge request template to regenerate a GitLab MR description from a diff. The process reads `.gitlab/merge_request_templates/MERGE_REQUEST_TEMPLATE.md` and updates the MR body to reflect the latest changes.

Does glab support updating a merge request body when the GitLab API fails?

Glab supports updating a merge request body directly via `glab mr update`, with a fallback to the `glab api` command. This ensures the MR body is safely refreshed even if the primary update method encounters issues.

Why does my automated merge request workflow fail on a branch without an upstream?

An automated merge request workflow fails on a branch without an upstream because it cannot push the latest changes to GitLab. The process requires local validation and branch pushing with upstream handling to detect and update the corresponding MR.