GitHub Action
Mark PR as Draft
v1.1
Latest version
Converts the current (or specified) pull request to a draft
token
: The GitHub token to allow authenticated actionspull-request-node-id
: The GitHub node id of the pull request to mark as draft
# Marks all newly opened pull requests as drafts
name: Draft on Open
on:
pull_request:
types: [ opened ]
jobs:
mark-as-draft:
name: Mark as draft
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Mark as draft
uses: voiceflow/draft-pr@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
When calling this action from a workflow triggered by a pull_request
event, it will automatically apply to the current pull request. If you want to apply this action to a different PR, you can retrieve its node ID by calling the command gh pr view $PR --json id --jq .id
where $PR
is the number, url, or branch of your PR.
MIT