diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3705553..f2cccb0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,38 +1,45 @@ -# 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: + pull_request: branches: [ main ] jobs: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - reqtest: + 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: | + echo $GITHUB_EVENT_PATH + cat $GITHUB_EVENT_PATH + 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 == true }} + 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 == false }} + run: echo "The fair" + + - name: test + run: echo ${{ github.event.pull_request.draft }} - - name: requirements test - run: | - python -m pip install -U pip - python -m pip install -r requirements.txt