From 0d06271bf6e4a299c0315a765dc3e97a2a97faf1 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 12:41:26 +0200 Subject: [PATCH] Update review.yml --- .github/workflows/review.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 309392064..c613b8610 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -11,6 +11,40 @@ permissions: contents: read jobs: +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + todraft: + runs-on: ubuntu-latest + + steps: + + - name: Set PR to draft + if: ${{ github.event.pull_request.draft == false }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -X PATCH \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + -d '{"draft": true}' \ + $(jq -r '.pull_request.url' $GITHUB_EVENT_PATH) + +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + + reqtest: + runs-on: ubuntu-latest + steps: + + - name: test draft + if: ${{ github.event.pull_request.draft == true }} + run: echo "The draft" + + - name: test fair + if: ${{ github.event.pull_request.draft == false }} + run: echo "The fair" + + - name: test + run: echo ${{ github.event.pull_request.draft }} # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #