Change PR to draft when it is (re)opened (#36417)
* draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft * draft --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
22
.github/workflows/change_pr_to_draft.yml
vendored
Normal file
22
.github/workflows/change_pr_to_draft.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Change PR to draft
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
convert_pr_to_draft:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Convert PR to draft
|
||||
if: github.event.pull_request.draft == false
|
||||
steps:
|
||||
- name: Convert PR to draft
|
||||
shell: bash
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
echo $PR_NUMBER
|
||||
gh pr ready $PR_NUMBER --repo $REPO --undo
|
||||
gh pr comment $PR_NUMBER --repo $REPO --body "Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the \`Ready for review\` button (at the bottom of the PR page)."
|
||||
Reference in New Issue
Block a user