Skip to content

fix(profiling): fix data race when accessing span for thread #7221

fix(profiling): fix data race when accessing span for thread

fix(profiling): fix data race when accessing span for thread #7221

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/github-script@v6.4.1
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,
});