Skip to content

ci: Annotate PR descriptions with branch and user info - #65

Open
AhooPao wants to merge 2 commits into
BossZou:mainfrom
AhooPao:pr-branch-info
Open

ci: Annotate PR descriptions with branch and user info#65
AhooPao wants to merge 2 commits into
BossZou:mainfrom
AhooPao:pr-branch-info

Conversation

@AhooPao

@AhooPao AhooPao commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two-part change so that every squash-merge commit's Extended description includes source/target branch and user info:

  1. A new workflow (.github/workflows/pr-branch-info.yml) appends a Branch info section to every PR description when the PR is opened:

    • Source user / source branch (head repository owner and head ref)
    • Target user / target branch (base repository owner and base ref)
  2. Required repository setting change (needs admin, see below): set squash_merge_commit_message to PR_BODY so the merge dialog's Extended description is pre-filled with the PR description instead of the commit list. This is what carries the Branch info section into the squash commit message at merge time.

Required repository setting (admin)

With the current settings (squash_merge_commit_message=COMMIT_MESSAGES), the Extended description at merge time is the commit list, and PR description content is dropped — so the branch info would never reach the merge commit.

Please change it via Settings → General → Pull Requests → Allow squash merging → Default commit message → "Pull request title and description", or run:

gh repo edit BossZou/jaclks --squash-merge-commit-message pr-title-description

Motivation

For PRs (especially from forks), it is useful to see in the merge commit who owns the source branch and which branches the merge involved.

Related issue

Closes #64

Test plan

  • Workflow YAML and shell syntax validated locally.
  • Script logic simulated locally with a mock gh CLI:
    • appends the section to empty and existing bodies
    • skips when the section is already present (idempotent)
    • hostile branch/user names are written literally (no command injection)
  • Note: the workflow first runs on PRs opened after this is merged (new workflow files do not run on the PR that adds them).

Checklist

  • CHANGELOG.md updated (CI-only change; entry added)

Add a GitHub Actions workflow that appends a "Branch info" section
(source/target user and branch) to the description of every new PR.

Co-Authored-By: Claude <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Co-Authored-By: Claude <noreply@anthropic.com>
@BossZou
BossZou self-requested a review August 13, 2026 17:34
@BossZou BossZou added the aci label Aug 13, 2026
@BossZou BossZou added this to the Version 0.0.1 milestone Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.14%. Comparing base (4c38672) to head (d4fe321).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #65   +/-   ##
=======================================
  Coverage   93.14%   93.14%           
=======================================
  Files          25       25           
  Lines         831      831           
  Branches      271      271           
=======================================
  Hits          774      774           
  Misses         32       32           
  Partials       25       25           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Other]: Add repo branch info when merging PRs

2 participants