diff --git a/.github/workflows/ready-for-review.yml b/.github/workflows/ready-for-review.yml new file mode 100644 index 0000000..878f5a1 --- /dev/null +++ b/.github/workflows/ready-for-review.yml @@ -0,0 +1,35 @@ +name: "Ready for Review" + +on: + pull_request_target: + types: + - opened + - converted_to_draft + - edited + +jobs: + mark-ready: + name: Mark Draft as Ready for Review + runs-on: ubuntu-latest + if: github.event.pull_request.draft == true && !startsWith(github.event.pull_request.title, '[WIP]') + permissions: + pull-requests: write + + steps: + - name: Mark PR as Ready for Review + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NODE_ID: ${{ github.event.pull_request.node_id }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + echo "Marking PR #${PR_NUMBER} as ready for review..." + gh api graphql -f query=' + mutation($id: ID!) { + markPullRequestReadyForReview(input: {pullRequestId: $id}) { + pullRequest { + id + isDraft + } + } + } + ' -f id="${PR_NODE_ID}"