Skip to content

chore(profiling): update relnote for endpoint stack v2 [backport 2.12] #7001

chore(profiling): update relnote for endpoint stack v2 [backport 2.12]

chore(profiling): update relnote for endpoint stack v2 [backport 2.12] #7001

name: Add milestone to pull requests
on:
# Only run when a PR is closed
pull_request:
types:
- closed
jobs:
add_milestone_to_pr:
# Only run if the PR was closed due to a merge
if: github.event.pull_request.merged == true
name: Add milestone to merged pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Include all history and tags
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
- name: Get target milestone
id: milestones
run: |
pip install -U pip
pip install packaging
scripts/get-target-milestone.py
- name: Update Pull Request
if: steps.milestones.outputs.milestone != null
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const title = "${{ steps.milestones.outputs.milestone }}";
const milestones = await github.rest.issues.listMilestones({
owner: context.repo.owner,
repo: context.repo.repo,
state: "open",
});
let milestone = milestones.data.find( (m) => m.title == title );
if (milestone === undefined) {
milestone = await github.rest.issues.createMilestone({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
});
}
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
milestone: milestone.number,
});