From 2d1d77f57abf0ac49d12e0926bff7a1dbd3f1700 Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 17:08:02 +0000 Subject: [PATCH 01/10] Resolve conflicts: keep pr command (renamed from create-pr) --- git-hangman-lab/SKILL.md | 2 + git-hangman-lab/scripts/create-pr | 95 +++++++++++++++++++++++++++++++ git-hangman-lab/scripts/git-ctrl | 4 +- 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100755 git-hangman-lab/scripts/create-pr diff --git a/git-hangman-lab/SKILL.md b/git-hangman-lab/SKILL.md index 57e2c19..85511ec 100644 --- a/git-hangman-lab/SKILL.md +++ b/git-hangman-lab/SKILL.md @@ -52,6 +52,8 @@ Manage pull requests on git.hangman-lab.top. {baseDir}/scripts/git-ctrl pr list {baseDir}/scripts/git-ctrl pr commits {baseDir}/scripts/git-ctrl pr merge [commit-id] [title] [message] +{baseDir}/scripts/git-ctrl pr show +``` ``` > **Note**: The access token will be automatically generated if not found. diff --git a/git-hangman-lab/scripts/create-pr b/git-hangman-lab/scripts/create-pr new file mode 100755 index 0000000..64c1b98 --- /dev/null +++ b/git-hangman-lab/scripts/create-pr @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Get the directory where this script is located +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +usage() { + echo "Usage: $0 [pr-title] [pr-body]" + echo "" + echo "Create a pull request on git.hangman-lab.top" + echo "" + echo "Arguments:" + echo " repo-local-path Local path to the git repository" + echo " head-branch Branch containing the changes" + echo " base-branch Branch to merge into (e.g., main)" + echo " pr-title Title of the pull request (optional, default: 'untitled pull request')" + echo " pr-body Body/description of the pull request (optional, default: '')" + exit 2 +} + +if [[ $# -lt 3 ]]; then + usage +fi + +REPO_LOCAL_PATH="$1" +HEAD_BRANCH="$2" +BASE_BRANCH="$3" +PR_TITLE="${4:-untitled pull request}" +PR_BODY="${5:-}" + +# Validate repo path +if [[ ! -d "$REPO_LOCAL_PATH/.git" ]]; then + echo "Error: Not a git repository: $REPO_LOCAL_PATH" + exit 1 +fi + +# Check if git-access-token exists, if not generate it +if ! secret-mgr list 2>/dev/null | grep -q "git-access-token"; then + echo "Access token not found, generating..." + "$SCRIPT_DIR/generate-access-token" +fi + +# Get the access token +GIT_TOKEN="$(secret-mgr get-secret --key git-access-token)" + +if [[ -z "$GIT_TOKEN" ]]; then + echo "Error: Failed to get git-access-token" + exit 1 +fi + +# Get remote URL from .git +REMOTE_URL="$(git -C "$REPO_LOCAL_PATH" remote get-url origin)" + +# Match pattern: https://git.hangman-lab.top/${owner}/${repo-name}.git +if [[ "$REMOTE_URL" =~ https://git\.hangman-lab\.top/([^/]+)/([^/]+)\.git ]]; then + OWNER="${BASH_REMATCH[1]}" + REPO_NAME="${BASH_REMATCH[2]}" +else + echo "Error: Invalid remote URL format: $REMOTE_URL" + echo "Expected: https://git.hangman-lab.top/\${owner}/\${repo-name}.git" + exit 1 +fi + +echo "Creating PR: $OWNER/$REPO_NAME ($HEAD_BRANCH -> $BASE_BRANCH)" + +# Create PR via API +RESPONSE=$(curl -s -X POST "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls" \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H "Authorization: token ${GIT_TOKEN}" \ + -d "$(jq -n \ + --arg head "$HEAD_BRANCH" \ + --arg base "$BASE_BRANCH" \ + --arg title "$PR_TITLE" \ + --arg body "$PR_BODY" \ + '{head: $head, base: $base, title: $title, body: $body}')") + +# Check if response contains an error +if echo "$RESPONSE" | jq -e '.message' >/dev/null 2>&1; then + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message') + echo "Error: $ERROR_MSG" + exit 1 +fi + +# Extract PR URL from response +PR_URL=$(echo "$RESPONSE" | jq -r '.html_url // empty') + +if [[ -n "$PR_URL" ]]; then + echo "Pull request created successfully!" + echo "URL: $PR_URL" +else + echo "Error: Failed to create pull request" + echo "Response: $RESPONSE" + exit 1 +fi diff --git a/git-hangman-lab/scripts/git-ctrl b/git-hangman-lab/scripts/git-ctrl index 4f301a2..1cf1cc4 100755 --- a/git-hangman-lab/scripts/git-ctrl +++ b/git-hangman-lab/scripts/git-ctrl @@ -11,7 +11,7 @@ if [[ $# -eq 0 ]]; then echo " check-git-cred Verify git credentials" echo " create-git-account Create a new git account" echo " create-repo Create a new repository" - echo " pr Pull request operations (create/list/commits/merge)" + echo " pr Pull request operations (create/list/commits/merge/show)" echo " generate-access-token Generate access token for current user" echo " link-keycloak Link Keycloak account with Gitea" echo " repo-add-collaborators Add collaborator to repository" @@ -37,7 +37,7 @@ case "$subcommand" in "$SCRIPT_DIR/create-repo" "$@" ;; pr) - "$SCRIPT_DIR/pr" "$@" + "$SCRIPT_DIR/pr" "$@" ;; generate-access-token) "$SCRIPT_DIR/generate-access-token" "$@" -- 2.49.1 From 3930adf36235986f58a24f9b89f8fcc7a2218b65 Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 14:56:43 +0000 Subject: [PATCH 02/10] fix: extract actual token from secret-mgr output secret-mgr get-secret outputs 'Access token was successfully created: ' so we need to extract just the token using awk '{print $NF}' --- git-hangman-lab/scripts/create-pr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-hangman-lab/scripts/create-pr b/git-hangman-lab/scripts/create-pr index 64c1b98..6841682 100755 --- a/git-hangman-lab/scripts/create-pr +++ b/git-hangman-lab/scripts/create-pr @@ -40,8 +40,8 @@ if ! secret-mgr list 2>/dev/null | grep -q "git-access-token"; then "$SCRIPT_DIR/generate-access-token" fi -# Get the access token -GIT_TOKEN="$(secret-mgr get-secret --key git-access-token)" +# Get the access token (extract actual token from "Access token was successfully created: ") +GIT_TOKEN="$(secret-mgr get-secret --key git-access-token | awk '{print $NF}')" if [[ -z "$GIT_TOKEN" ]]; then echo "Error: Failed to get git-access-token" -- 2.49.1 From bd41addc7dd0a086735474444e2d26422e157ad6 Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 17:08:49 +0000 Subject: [PATCH 03/10] Resolve conflicts: keep pr command with show subcommand --- git-hangman-lab/SKILL.md | 1 - git-hangman-lab/scripts/create-pr | 95 ------------------------------- git-hangman-lab/scripts/git-ctrl | 2 +- 3 files changed, 1 insertion(+), 97 deletions(-) delete mode 100755 git-hangman-lab/scripts/create-pr diff --git a/git-hangman-lab/SKILL.md b/git-hangman-lab/SKILL.md index 85511ec..bf0e2a9 100644 --- a/git-hangman-lab/SKILL.md +++ b/git-hangman-lab/SKILL.md @@ -54,7 +54,6 @@ Manage pull requests on git.hangman-lab.top. {baseDir}/scripts/git-ctrl pr merge [commit-id] [title] [message] {baseDir}/scripts/git-ctrl pr show ``` -``` > **Note**: The access token will be automatically generated if not found. diff --git a/git-hangman-lab/scripts/create-pr b/git-hangman-lab/scripts/create-pr deleted file mode 100755 index 6841682..0000000 --- a/git-hangman-lab/scripts/create-pr +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Get the directory where this script is located -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" - -usage() { - echo "Usage: $0 [pr-title] [pr-body]" - echo "" - echo "Create a pull request on git.hangman-lab.top" - echo "" - echo "Arguments:" - echo " repo-local-path Local path to the git repository" - echo " head-branch Branch containing the changes" - echo " base-branch Branch to merge into (e.g., main)" - echo " pr-title Title of the pull request (optional, default: 'untitled pull request')" - echo " pr-body Body/description of the pull request (optional, default: '')" - exit 2 -} - -if [[ $# -lt 3 ]]; then - usage -fi - -REPO_LOCAL_PATH="$1" -HEAD_BRANCH="$2" -BASE_BRANCH="$3" -PR_TITLE="${4:-untitled pull request}" -PR_BODY="${5:-}" - -# Validate repo path -if [[ ! -d "$REPO_LOCAL_PATH/.git" ]]; then - echo "Error: Not a git repository: $REPO_LOCAL_PATH" - exit 1 -fi - -# Check if git-access-token exists, if not generate it -if ! secret-mgr list 2>/dev/null | grep -q "git-access-token"; then - echo "Access token not found, generating..." - "$SCRIPT_DIR/generate-access-token" -fi - -# Get the access token (extract actual token from "Access token was successfully created: ") -GIT_TOKEN="$(secret-mgr get-secret --key git-access-token | awk '{print $NF}')" - -if [[ -z "$GIT_TOKEN" ]]; then - echo "Error: Failed to get git-access-token" - exit 1 -fi - -# Get remote URL from .git -REMOTE_URL="$(git -C "$REPO_LOCAL_PATH" remote get-url origin)" - -# Match pattern: https://git.hangman-lab.top/${owner}/${repo-name}.git -if [[ "$REMOTE_URL" =~ https://git\.hangman-lab\.top/([^/]+)/([^/]+)\.git ]]; then - OWNER="${BASH_REMATCH[1]}" - REPO_NAME="${BASH_REMATCH[2]}" -else - echo "Error: Invalid remote URL format: $REMOTE_URL" - echo "Expected: https://git.hangman-lab.top/\${owner}/\${repo-name}.git" - exit 1 -fi - -echo "Creating PR: $OWNER/$REPO_NAME ($HEAD_BRANCH -> $BASE_BRANCH)" - -# Create PR via API -RESPONSE=$(curl -s -X POST "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls" \ - -H 'accept: application/json' \ - -H 'Content-Type: application/json' \ - -H "Authorization: token ${GIT_TOKEN}" \ - -d "$(jq -n \ - --arg head "$HEAD_BRANCH" \ - --arg base "$BASE_BRANCH" \ - --arg title "$PR_TITLE" \ - --arg body "$PR_BODY" \ - '{head: $head, base: $base, title: $title, body: $body}')") - -# Check if response contains an error -if echo "$RESPONSE" | jq -e '.message' >/dev/null 2>&1; then - ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message') - echo "Error: $ERROR_MSG" - exit 1 -fi - -# Extract PR URL from response -PR_URL=$(echo "$RESPONSE" | jq -r '.html_url // empty') - -if [[ -n "$PR_URL" ]]; then - echo "Pull request created successfully!" - echo "URL: $PR_URL" -else - echo "Error: Failed to create pull request" - echo "Response: $RESPONSE" - exit 1 -fi diff --git a/git-hangman-lab/scripts/git-ctrl b/git-hangman-lab/scripts/git-ctrl index 1cf1cc4..11a13e3 100755 --- a/git-hangman-lab/scripts/git-ctrl +++ b/git-hangman-lab/scripts/git-ctrl @@ -37,7 +37,7 @@ case "$subcommand" in "$SCRIPT_DIR/create-repo" "$@" ;; pr) - "$SCRIPT_DIR/pr" "$@" + "$SCRIPT_DIR/pr" "$@" ;; generate-access-token) "$SCRIPT_DIR/generate-access-token" "$@" -- 2.49.1 From 77fa2f77bc4b55aecc740974a59ba4a0258e8bad Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 15:57:17 +0000 Subject: [PATCH 04/10] fix(pr): use /pulls instead of /pulls/pinned for list command --- git-hangman-lab/scripts/pr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index 0fc9c53..3a5b35a 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -97,7 +97,7 @@ cmd_list() { echo "Listing PRs for: $OWNER/$REPO_NAME" - RESPONSE=$(curl -s -X GET "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/pinned" \ + RESPONSE=$(curl -s -X GET "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls" \ -H 'accept: application/json' \ -H "Authorization: token ${token}") -- 2.49.1 From d764f30589d327a4973bb7606ee97b08ae37c81c Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 16:09:00 +0000 Subject: [PATCH 05/10] fix(pr): proper HTTP status code handling for merge command Handle different HTTP status codes returned by merge API: - 200: success (check merged field) - 409: conflict (output error message) - 404: not found - 423: repo archived - 405: empty response / try again later - etc: generic error handling --- git-hangman-lab/scripts/pr | 64 +++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index 3a5b35a..975185e 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -180,27 +180,61 @@ cmd_merge() { merge_when_checks_succeed: true }') - RESPONSE=$(curl -s -X POST "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/${pr_index}/merge" \ + TEMP_FILE=$(mktemp) + HTTP_CODE=$(curl -s -o "$TEMP_FILE" -w "%{http_code}" -X POST "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/${pr_index}/merge" \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: token ${token}" \ -d "$json") - if echo "$RESPONSE" | jq -e '.message' >/dev/null 2>&1; then - ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message') - echo "Error: $ERROR_MSG" - exit 1 - fi + RESPONSE=$(cat "$TEMP_FILE") + rm -f "$TEMP_FILE" - MERGED=$(echo "$RESPONSE" | jq -r '.merged') - - if [[ "$MERGED" == "true" ]]; then - echo "Pull request merged successfully!" - else - echo "Error: Failed to merge pull request" - echo "$RESPONSE" | jq '.' - exit 1 - fi + case "$HTTP_CODE" in + 200) + MERGED=$(echo "$RESPONSE" | jq -r '.merged') + if [[ "$MERGED" == "true" ]]; then + echo "Pull request merged successfully!" + else + echo "Error: Failed to merge pull request" + echo "$RESPONSE" | jq '.' + exit 1 + fi + ;; + 409) + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // "Conflicting changes"') + echo "Error [$HTTP_CODE]: $ERROR_MSG" + exit 1 + ;; + 404) + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // "Not found"') + echo "Error [$HTTP_CODE]: $ERROR_MSG" + exit 1 + ;; + 423) + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // "Repository is archived"') + echo "Error [$HTTP_CODE]: $ERROR_MSG" + exit 1 + ;; + 405) + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // empty') + if [[ -n "$ERROR_MSG" && "$ERROR_MSG" != "null" ]]; then + echo "Error [$HTTP_CODE]: $ERROR_MSG" + else + echo "Error [$HTTP_CODE]: Please try again later" + fi + exit 1 + ;; + *) + if echo "$RESPONSE" | jq -e '.message' >/dev/null 2>&1; then + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message') + echo "Error [$HTTP_CODE]: $ERROR_MSG" + else + echo "Error [$HTTP_CODE]: Unknown error" + fi + exit 1 + ;; + esac } # Usage -- 2.49.1 From a7700a5f1574502e62f30128dd88b6b1333a7cc2 Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 16:28:33 +0000 Subject: [PATCH 06/10] fix(pr): for 405 errors, output API message directly --- git-hangman-lab/scripts/pr | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index 975185e..48e8a7e 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -217,12 +217,7 @@ cmd_merge() { exit 1 ;; 405) - ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // empty') - if [[ -n "$ERROR_MSG" && "$ERROR_MSG" != "null" ]]; then - echo "Error [$HTTP_CODE]: $ERROR_MSG" - else - echo "Error [$HTTP_CODE]: Please try again later" - fi + echo "$RESPONSE" | jq -r '.message' exit 1 ;; *) -- 2.49.1 From 5725ac79bbae9f2a83711dab4d0330ff076bb40e Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 16:43:50 +0000 Subject: [PATCH 07/10] feat(pr): add show subcommand and refine merge output messages - Add 'pr show' subcommand: GET /repos/{owner}/{repo}/pulls/{index} - Change 200 success: 'merge success' - Change 405 error: 'merge failed check the pr status' --- git-hangman-lab/scripts/pr | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index 48e8a7e..0a1ab72 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -134,6 +134,30 @@ cmd_commits() { echo "$RESPONSE" | jq -r '.[] | "\(.sha[0:7])\t\(.commit.message | split("\n")[0])"' 2>/dev/null || echo "$RESPONSE" } +# Subcommand: show +cmd_show() { + local repo_path="$1" + local pr_index="$2" + + get_repo_info "$repo_path" + local token + token="$(ensure_token)" + + echo "Showing PR #$pr_index in: $OWNER/$REPO_NAME" + + RESPONSE=$(curl -s -X GET "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/${pr_index}" \ + -H 'accept: application/json' \ + -H "Authorization: token ${token}") + + if echo "$RESPONSE" | jq -e '.message' >/dev/null 2>&1; then + ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message') + echo "Error: $ERROR_MSG" + exit 1 + fi + + echo "$RESPONSE" | jq '.' +} + # Subcommand: merge cmd_merge() { local repo_path="$1" @@ -194,9 +218,9 @@ cmd_merge() { 200) MERGED=$(echo "$RESPONSE" | jq -r '.merged') if [[ "$MERGED" == "true" ]]; then - echo "Pull request merged successfully!" + echo "merge success" else - echo "Error: Failed to merge pull request" + echo "merge failed" echo "$RESPONSE" | jq '.' exit 1 fi @@ -217,7 +241,7 @@ cmd_merge() { exit 1 ;; 405) - echo "$RESPONSE" | jq -r '.message' + echo "merge failed check the pr status" exit 1 ;; *) @@ -243,6 +267,7 @@ usage() { echo " commits List commits in a PR" echo " merge [commit-id] [title] [message]" echo " Merge a pull request" + echo " show Show PR details" echo "" echo " can be: merge, squash, rebase, manually-merged" exit 2 @@ -285,6 +310,13 @@ case "$COMMAND" in fi cmd_merge "$@" ;; + show) + if [[ $# -lt 2 ]]; then + echo "Error: show requires " + exit 2 + fi + cmd_show "$@" + ;; *) echo "Error: Unknown command: $COMMAND" usage -- 2.49.1 From 1feef0c5b6739a068bb6f1d0cdff93b4f632caed Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 16:56:32 +0000 Subject: [PATCH 08/10] fix(pr show): slim down output, remove nested repo/user objects --- git-hangman-lab/scripts/pr | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index 0a1ab72..a683fb4 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -155,7 +155,19 @@ cmd_show() { exit 1 fi - echo "$RESPONSE" | jq '.' + echo "$RESPONSE" | jq '{ + id, number, title, body, state, draft, mergeable, merged, + additions, deletions, changed_files, comments, + html_url, diff_url, patch_url, + user: .user | {login, full_name, html_url}, + labels, + milestone, + assignee, + base: .base | {label, ref, sha}, + head: .head | {label, ref, sha}, + merge_base, + created_at, updated_at, closed_at + }' } # Subcommand: merge -- 2.49.1 From f782bce0a3e0c9bfb29e24f8cd16bf5ad8b85cdb Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 17:00:23 +0000 Subject: [PATCH 09/10] fix(pr show): remove user and assignee fields --- git-hangman-lab/scripts/pr | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index a683fb4..f1ad15b 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -159,10 +159,8 @@ cmd_show() { id, number, title, body, state, draft, mergeable, merged, additions, deletions, changed_files, comments, html_url, diff_url, patch_url, - user: .user | {login, full_name, html_url}, labels, milestone, - assignee, base: .base | {label, ref, sha}, head: .head | {label, ref, sha}, merge_base, -- 2.49.1 From b85d40f587fd4006329b073dd09b8fcaa29d5a63 Mon Sep 17 00:00:00 2001 From: lyn Date: Wed, 1 Apr 2026 17:03:34 +0000 Subject: [PATCH 10/10] fix(pr merge): on 405, fetch and print PR merge status --- git-hangman-lab/scripts/pr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-hangman-lab/scripts/pr b/git-hangman-lab/scripts/pr index f1ad15b..9f237f9 100755 --- a/git-hangman-lab/scripts/pr +++ b/git-hangman-lab/scripts/pr @@ -252,6 +252,11 @@ cmd_merge() { ;; 405) echo "merge failed check the pr status" + # Fetch PR details to show merge status + PR_INFO=$(curl -s -X GET "https://git.hangman-lab.top/api/v1/repos/${OWNER}/${REPO_NAME}/pulls/${pr_index}" \ + -H 'accept: application/json' \ + -H "Authorization: token ${token}") + echo "$PR_INFO" | jq '{mergeable: .mergeable, head_sha: .head.sha, base_ref: .base.ref, head_ref: .head.ref}' exit 1 ;; *) -- 2.49.1