From a91aedf47ed13fc09398316110ed6c54db2574eb Mon Sep 17 00:00:00 2001 From: Loic Denuziere Date: Sun, 5 Apr 2020 18:26:35 +0200 Subject: [PATCH] CI: fix publish script --- .github/workflows/build.yml | 2 -- .github/workflows/publish.yml | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b37017..67d87aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,6 @@ name: Build on: push: pull_request: - release: - types: [published] jobs: build: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c9a5cbb..a47b7c1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,15 +10,15 @@ jobs: steps: - name: Download nupkg run: | - runs_url = "https://api.github.com/repos/${{github.repository}}/actions/workflows/build.yml/runs" - run_id = $(curl -s -H "Accept: application/vnd.github.antiope-preview+json" "$runs_url" \ - | jq '.workflow_runs[] | select(.head_sha == "${{github.sha}}").id') + runs_url="https://api.github.com/repos/${{github.repository}}/actions/workflows/build.yml/runs" + run_id=$(curl -s -H "Accept: application/vnd.github.antiope-preview+json" "$runs_url" \ + | jq '[.workflow_runs[] | select(.head_sha == "${{github.sha}}").id][0]') - artifacts_url = "https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts" - artifact_id = $(curl -s -H 'Accept: application/vnd.github.antiope-preview+json' \ + artifacts_url="https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts" + artifact_id=$(curl -s -H 'Accept: application/vnd.github.antiope-preview+json' "$artifacts_url" \ | jq '.artifacts[0].id') - artifact_url = "https://${{secrets.GITHUB_PAT}}@api.github.com/repos/${{github.repository}}/actions/artifacts/$artifact_id/zip" + artifact_url="https://${{secrets.GH_PAT}}@api.github.com/repos/${{github.repository}}/actions/artifacts/$artifact_id/zip" curl -L -o nuget.zip "$artifact_url" unzip nuget.zip -d nuget