diff --git a/.github/workflows/merge-from-milestone.yml b/.github/workflows/merge-from-milestone.yml index 88ddaac..3adb106 100644 --- a/.github/workflows/merge-from-milestone.yml +++ b/.github/workflows/merge-from-milestone.yml @@ -166,13 +166,24 @@ jobs: echo "Prepared PR body:" echo "$pr_body" - # Create the Pull Request with the label 'milestone-merge' - curl -s -X POST -H "Authorization: token $BOT_TOKEN" \ + # Create the Pull Request (without the label for now) + response=$(curl -s -X POST -H "Authorization: token $BOT_TOKEN" \ -H "Accept: application/vnd.github+json" \ https://api.github.com/repos/${{ github.repository }}/pulls \ -d "$(jq -n --arg title "$pr_title" \ --arg head "$CHERRY_PICK_BRANCH" \ --arg base "$TARGET_BRANCH" \ --arg body "$pr_body" \ - --argjson labels '["milestone-merge"]' \ - '{title: $title, head: $head, base: $base, body: $body, labels: $labels}')" + '{title: $title, head: $head, base: $base, body: $body}')") + + # Extract the PR number from the response + pr_number=$(echo "$response" | jq -r '.number') + + echo "Created PR #$pr_number" + + - name: Add Label to Created Pull Request + run: | + curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/$pr_number/labels \ + -d "$(jq -n --arg label "milestone-merge" '{labels: [$label]}')" diff --git a/hello.go b/hello.go index 8e2f6c4..67520dc 100644 --- a/hello.go +++ b/hello.go @@ -3,7 +3,6 @@ package main import "fmt" func main() { - // 你好 fmt.Println("hello") }