From c648ed8b10252efec563dab6442693de406f2adf Mon Sep 17 00:00:00 2001 From: Radu Marias Date: Sun, 2 Jun 2024 05:16:18 +0300 Subject: [PATCH] Update PyPI.yml --- .github/workflows/PyPI.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/PyPI.yml b/.github/workflows/PyPI.yml index d1ad17b..a89f22b 100644 --- a/.github/workflows/PyPI.yml +++ b/.github/workflows/PyPI.yml @@ -23,20 +23,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger target workflow - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { owner, repo } = context.repo; - const workflow_id = 'tests.yml'; // or use the workflow ID if known - const ref = 'main'; // the branch you want to run the workflow on - - await github.actions.createWorkflowDispatch({ - owner, - repo, - workflow_id, - ref, - }); + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + https://api.github.com/repos/${{ github.repository }}/actions/workflows/tests.yml/dispatches \ + -d '{"ref":"main"}' + linux: runs-on: ${{ matrix.platform.runner }} strategy: @@ -144,7 +139,7 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [linux, windows, macos, sdist] + needs: [tests, linux, windows, macos, sdist] steps: - uses: actions/download-artifact@v4 - name: Publish to PyPI