Skip to content

[ISSUE #2151]♻️Refactor RegisterBrokerResponseHeader with derive marco RequestHeaderCodec #450

[ISSUE #2151]♻️Refactor RegisterBrokerResponseHeader with derive marco RequestHeaderCodec

[ISSUE #2151]♻️Refactor RegisterBrokerResponseHeader with derive marco RequestHeaderCodec #450

name: Associate Milestone(PR)
on:
pull_request_target:
types: [ opened ]
jobs:
associate-milestone-PR:
runs-on: ubuntu-latest
env:
MILESTONE_TITLE: ${{ secrets.MILESTONE_TITLE }}
steps:
- name: Associate Milestone
uses: actions/github-script@v7
with:
github-token: ${{ secrets.BOT_TOKEN_1 }}
script: |
const { owner, repo } = context.repo;
const issueNumber = context.issue.number;
const milestoneTitle = process.env.MILESTONE_TITLE;
// Get the milestone ID by title
const milestones = await github.rest.issues.listMilestones({
owner,
repo,
});
const milestone = milestones.data.find(m => m.title === milestoneTitle);
if (!milestone) {
throw new Error(`Milestone with title "${milestoneTitle}" not found`);
}
// Associate the issue with the milestone
await github.rest.issues.update({
owner,
repo,
issue_number: issueNumber,
milestone: milestone.number,
});
console.log(`Associated issue #${issueNumber} with milestone "${milestoneTitle}"`);