From 1c0e3fb5c6d2f01f1278b63c3c7c2558d28a6035 Mon Sep 17 00:00:00 2001 From: zou-yinghao Date: Fri, 14 Aug 2026 01:31:06 +0800 Subject: [PATCH 1/2] ci: Annotate PR descriptions with branch and user info 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 --- .github/workflows/pr-branch-info.yml | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pr-branch-info.yml diff --git a/.github/workflows/pr-branch-info.yml b/.github/workflows/pr-branch-info.yml new file mode 100644 index 0000000..51cbecf --- /dev/null +++ b/.github/workflows/pr-branch-info.yml @@ -0,0 +1,42 @@ +name: Add branch info to PR description + +on: + pull_request: + types: [opened, reopened] + +permissions: + pull-requests: write + +jobs: + add-branch-info: + runs-on: ubuntu-latest + steps: + - name: Append branch info to PR description + env: + GH_TOKEN: ${{ github.token }} + PR_SOURCE_USER: ${{ github.event.pull_request.head.user.login }} + PR_TARGET_USER: ${{ github.event.pull_request.base.user.login }} + PR_HEAD_REF: ${{ github.head_ref }} + PR_BASE_REF: ${{ github.base_ref }} + run: | + PR_NUMBER="${{ github.event.pull_request.number }}" + CURRENT_BODY="$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json body --jq '.body // ""')" + + if printf '%s' "$CURRENT_BODY" | grep -q ''; then + echo "Branch info already present, skipping." + exit 0 + fi + + { + printf '%s\n' "$CURRENT_BODY" + printf '\n' + printf '%s\n' '' + printf '%s\n' '## Branch info' + printf '\n' + printf '%s\n' "- Source user: \`$PR_SOURCE_USER\`" + printf '%s\n' "- Source branch: \`$PR_HEAD_REF\`" + printf '%s\n' "- Target user: \`$PR_TARGET_USER\`" + printf '%s\n' "- Target branch: \`$PR_BASE_REF\`" + } > "$RUNNER_TEMP/body.md" + + gh pr edit "$PR_NUMBER" --repo "${{ github.repository }}" --body-file "$RUNNER_TEMP/body.md" From d4fe3210ac6f713683358efb6bb7e94810df34c7 Mon Sep 17 00:00:00 2001 From: zou-yinghao Date: Fri, 14 Aug 2026 01:32:09 +0800 Subject: [PATCH 2/2] docs: Update CHANGELOG for PR branch info workflow Co-Authored-By: Claude --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e0a4f1..181d565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Please mark all change in change log and use the issue from GitHub - [#56](https://github.com/BossZou/jaclks/pull/56) cancel windows platform support - [#58](https://github.com/BossZou/jaclks/pull/58) Remove windows support badge and update Supported Platforms - [#61](https://github.com/BossZou/jaclks/pull/61) Set BossZou as project code onwer +- [#65](https://github.com/BossZou/jaclks/pull/65) Annotate PR descriptions with source/target branch and user info ## Document - [#22](https://github.com/BossZou/jaclks/pull/22) Add license Apache 2.0 and code quality badge