Remove milestone from unmerged PRs (#41216)
* Remove milestone from unmerged PRs * Add pr write permission to milestone manager
This commit is contained in:
parent
ab51a761a3
commit
0a11d03ce5
|
@ -0,0 +1,26 @@
|
|||
name: Milestone Manager
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [milestoned]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
remove-milestone-from-unmerged-prs:
|
||||
name: "Remove Milestone from Unmerged PRs"
|
||||
if: github.event.pull_request.merged != true
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number,
|
||||
milestone: null,
|
||||
});
|
|
@ -38,9 +38,7 @@ jobs:
|
|||
with:
|
||||
php-version: '7.4'
|
||||
- name: 'Run the script to assign a milestone'
|
||||
if: |
|
||||
!github.event.pull_request.milestone &&
|
||||
github.event.pull_request.base.ref == 'trunk'
|
||||
if: github.event.pull_request.base.ref == 'trunk'
|
||||
run: php assign-milestone-to-merged-pr.php
|
||||
env:
|
||||
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
|
||||
|
|
Loading…
Reference in New Issue