Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Oct 28, 2024
1 parent 5cc0614 commit 39586a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/cleanup-after-milestone-prs-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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 }}
15 changes: 6 additions & 9 deletions .github/workflows/merge-from-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,21 @@ 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' }}
TARGET_BRANCH: ${{ github.event.inputs.target_branch || 'pre-release-v3.8.2' }}
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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 39586a1

Please sign in to comment.