[ISSUE #2151]♻️Refactor RegisterBrokerResponseHeader with derive marco RequestHeaderCodec #450
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"`); |