[infra] Reduce Overdue ratio thresholds #22
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: Cherry pick onto target branches | |
on: | |
pull_request_target: | |
branches: | |
- 'v*.x' | |
- 'master' | |
types: ['closed'] | |
workflow_call: | |
permissions: {} | |
jobs: | |
detect_cherry_pick_targets: | |
runs-on: ubuntu-latest | |
name: Detect cherry-pick targets | |
permissions: | |
pull-requests: write | |
contents: write | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }} | |
outputs: | |
targetBranches: ${{ steps.detect.outputs.TARGET_BRANCHES }} | |
reviewers: ${{ steps.detect.outputs.REVIEWERS }} | |
labels: ${{ steps.detect.outputs.LABELS }} | |
steps: | |
- name: Check out mui-public repo | |
id: checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
# Check this repository out, otherwise the script won't be available, | |
# as it otherwise checks out the repository where the workflow caller is located | |
repository: mui/mui-public | |
- name: Detect target | |
id: detect | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
script: | | |
const script = require('./.github/workflows/scripts/prs/detectTargetBranch.js'); | |
await script({core, github, context}); | |
open_cherry_pick_pr: | |
runs-on: ubuntu-latest | |
name: Open cherry-pick PR with target branch | |
if: needs.detect_cherry_pick_targets.outputs.targetBranches != '' | |
strategy: | |
matrix: | |
branch: ${{ fromJSON(needs.detect_cherry_pick_targets.outputs.targetBranches) }} | |
permissions: | |
pull-requests: write | |
contents: write | |
needs: detect_cherry_pick_targets | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Cherry pick and create the new PR | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: carloscastrojumo/github-cherry-pick-action@503773289f4a459069c832dc628826685b75b4b3 # v1.0.10 | |
with: | |
# the action will run for each value in matrix.branch | |
branch: ${{ matrix.branch }} | |
body: 'Cherry-pick of #{old_pull_request_id}' | |
cherry-pick-branch: ${{ format('cherry-pick-{0}', github.event.number) }} | |
title: '{old_title} (@${{ github.event.pull_request.user.login }})' | |
# assigning the original reviewers to the new PR | |
reviewers: ${{ needs.detect_cherry_pick_targets.outputs.reviewers }} | |
# instead of inheriting labels (including target branch label, etc.), we filter and set the labels explicitly | |
inherit_labels: false | |
labels: ${{ needs.detect_cherry_pick_targets.outputs.labels }} |