From 8361b0ff9e94891b03a015bf144932b163743a0d Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 10:32:40 +0200 Subject: [PATCH 1/8] Update test.yml --- .github/workflows/test.yml | 51 ++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3705553..786743b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,38 +1,41 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Test on: - push: - branches: [ main ] + pull_request: + types: + - opened jobs: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - reqtest: + todraft: + runs-on: ubuntu-latest + + steps: + + - name: Set PR to draft + 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) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10"] +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # + reqtest: + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} + - name: test draft + if: github.event.pull_request.draft == 'false' + run: echo "The draft" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: test fair + if: github.event.pull_request.draft == 'true' + run: echo "The fair" - - name: requirements test - run: | - python -m pip install -U pip - python -m pip install -r requirements.txt +# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # From 60907812e8d069a9e06944bdedbebc08f275975d Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 10:35:33 +0200 Subject: [PATCH 2/8] Apply suggestions from code review --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 786743b..a69d150 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,7 @@ name: Test on: pull_request: - types: - - opened + branches: [ main ] jobs: @@ -37,5 +36,8 @@ jobs: - name: test fair if: github.event.pull_request.draft == 'true' run: echo "The fair" + + - name: test + run: echo ${{ github.event.pull_request.draft }} # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # From ecbeef7e8d14cddf05f560c2d855c914be7e7b3b Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 10:38:03 +0200 Subject: [PATCH 3/8] Apply suggestions from code review --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a69d150..7cb3690 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,11 +30,11 @@ jobs: steps: - name: test draft - if: github.event.pull_request.draft == 'false' + if: ${{ github.event.pull_request.draft == 'false' }} run: echo "The draft" - name: test fair - if: github.event.pull_request.draft == 'true' + if: ${{ github.event.pull_request.draft == 'true' }} run: echo "The fair" - name: test From 31d5bcd5e654b1ef6399ac193f8c81d5be71dbd5 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 10:40:10 +0200 Subject: [PATCH 4/8] Apply suggestions from code review --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cb3690..9c2d9ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,11 +30,11 @@ jobs: steps: - name: test draft - if: ${{ github.event.pull_request.draft == 'false' }} + if: ${{ github.event.pull_request.draft == true }} run: echo "The draft" - name: test fair - if: ${{ github.event.pull_request.draft == 'true' }} + if: ${{ github.event.pull_request.draft == false }} run: echo "The fair" - name: test From 5ab32e7c91807120dadcf9330ced60db8c4fa55c Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 11:58:56 +0200 Subject: [PATCH 5/8] Update .github/workflows/test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c2d9ae..b370381 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,7 @@ jobs: steps: - name: Set PR to draft + if: ${{ github.event.pull_request.draft == false }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | From f97b62c49a39e2254a4e5a3f56c7147aa4b111ac Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 12:33:48 +0200 Subject: [PATCH 6/8] Update .github/workflows/test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b370381..e3d6223 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + echo $GITHUB_EVENT_PATH curl -X PATCH \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ From 2aae87f0c5888e235fb9220aeddc1f4b940e0be1 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Sat, 28 Dec 2024 12:35:37 +0200 Subject: [PATCH 7/8] Update .github/workflows/test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3d6223..900b648 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo $GITHUB_EVENT_PATH + cat $GITHUB_EVENT_PATH curl -X PATCH \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ From 3ea877326fd46f2574cec2318fd8f6176725e186 Mon Sep 17 00:00:00 2001 From: Roman Babenko Date: Thu, 6 Mar 2025 07:53:29 +0200 Subject: [PATCH 8/8] Update .github/workflows/test.yml --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 900b648..f2cccb0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,4 +43,3 @@ jobs: - name: test run: echo ${{ github.event.pull_request.draft }} -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #