DEBUG-3568 Inject logger into transport code #2422
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: Add milestone to merged pull requests | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
types: [closed] | |
jobs: | |
add_milestone: | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
runs-on: ubuntu-22.04 | |
if: github.event.pull_request.merged == true && github.event.pull_request.milestone == null | |
steps: | |
- name: Checkout code | |
# Checks out the branch that the pull request is merged into | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
ref: ${{ github.event.pull_request.base.ref }} | |
- name: Get major version from gemspec | |
# Parse the gemspec and return the major version | |
id: version | |
run: | | |
VERSION=$(ruby -e "puts Gem::Specification.load(Dir.glob('*.gemspec').first).version.to_s.split('.').first") | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
- name: Get project milestones | |
id: milestones | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const milestones = await github.rest.issues.listMilestones({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: 'open' | |
}) | |
return milestones.data | |
- name: Update Pull Request | |
# Update the merged pull request with the milestone starts with the major version | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const milestones = ${{steps.milestones.outputs.result}} | |
const majorVersion = ${{steps.version.outputs.version}} | |
const milestone = milestones.find(m => m.title.startsWith(majorVersion)) | |
if (milestone) { | |
await github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: ${{ github.event.pull_request.number }}, | |
milestone: milestone.number | |
}) | |
} |