feat: set git cherry pick and Milestone

This commit is contained in:
Xinwei Xiong (cubxxw) 2024-03-20 10:13:59 +08:00
parent 0274d516e0
commit d1f800bdba
2 changed files with 6 additions and 4 deletions

View File

@ -25,6 +25,7 @@ jobs:
- name: Comment cherry-pick command
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
if (!pr.merged) {
@ -63,5 +64,4 @@ jobs:
repo: context.repo.repo,
issue_number: pr.number,
body: cherryPickCmd
});
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
});

View File

@ -41,6 +41,7 @@ jobs:
steps:
- uses: actions/github-script@v7 # v6
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
if (!context.payload.pull_request.merged) {
console.log('PR was not merged, skipping.');
@ -56,9 +57,10 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
sort: 'due_on',
direction: 'asc'
sort: 'title',
direction: 'desc'
})
if (milestones.data.length === 0) {
console.log('There are no milestones, skipping.');
return;