From 39586a18c093bdb7126161a1414337837ec8800b Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Mon, 28 Oct 2024 11:39:33 +0800 Subject: [PATCH] fix --- .../cleanup-after-milestone-prs-merged.yml | 18 +++++++++--------- .github/workflows/merge-from-milestone.yml | 15 ++++++--------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cleanup-after-milestone-prs-merged.yml b/.github/workflows/cleanup-after-milestone-prs-merged.yml index 4e9cc40..ff4e802 100644 --- a/.github/workflows/cleanup-after-milestone-prs-merged.yml +++ b/.github/workflows/cleanup-after-milestone-prs-merged.yml @@ -36,15 +36,6 @@ jobs: echo "proceed=false" >> $GITHUB_OUTPUT fi - - name: Delete branch after PR close - if: steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge') - run: | - BRANCH_NAME="${{ github.event.pull_request.head.ref }}" - echo "Branch to delete: $BRANCH_NAME" - git push origin --delete "$BRANCH_NAME" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Use extracted PR numbers and label PRs if: (steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge')) && github.event.pull_request.merged == true run: | @@ -63,3 +54,12 @@ jobs: done env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete branch after PR close + if: steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge') + run: | + BRANCH_NAME="${{ github.event.pull_request.head.ref }}" + echo "Branch to delete: $BRANCH_NAME" + git push origin --delete "$BRANCH_NAME" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/merge-from-milestone.yml b/.github/workflows/merge-from-milestone.yml index d9110b0..e04e291 100644 --- a/.github/workflows/merge-from-milestone.yml +++ b/.github/workflows/merge-from-milestone.yml @@ -9,16 +9,13 @@ on: workflow_dispatch: inputs: milestone_name: - description: 'Milestone name to collect closed PRs from' + description: "Milestone name to collect closed PRs from" required: true - default: 'v3.8.2' + default: "v3.8.2" target_branch: - description: 'Target branch to merge the consolidated PR' + description: "Target branch to merge the consolidated PR" required: true - default: 'pre-release-v3.8.2' - - schedule: - - cron: '0 2 * * 0' + default: "pre-release-v3.8.2" env: MILESTONE_NAME: ${{ github.event.inputs.milestone_name || 'v3.8.2' }} @@ -26,7 +23,7 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BOT_TOKEN: ${{ secrets.BOT_TOKEN }} LABEL_NAME: cherry-picked - TEMP_DIR: /tmp # Using /tmp as the temporary directory + TEMP_DIR: /tmp # Using /tmp as the temporary directory jobs: cherry_pick_milestone_prs: @@ -123,7 +120,7 @@ jobs: short_commit_hash=$(echo "$merge_commit" | cut -c 1-7) # Append PR details to the body - echo "- $pr_title: (#$pr_number) ($short_commit_hash)" >> ${{ env.TEMP_DIR }}/pr_body.txt + echo "- $pr_title (#$pr_number) ($short_commit_hash)" >> ${{ env.TEMP_DIR }}/pr_body.txt if [ "$merge_commit" != "null" ];then echo "$merge_commit" >> ${{ env.TEMP_DIR }}/commit_hashes.txt