Skip to content

Commit 168b299

Browse files
authored
Merge pull request #14 from nike4613/ci-wait
Wait for packages to be available before trying to push them
2 parents 31c89d1 + ec64b9a commit 168b299

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/upload-packages.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,36 @@ jobs:
4545
- name: Install .NET SDK
4646
uses: nike4613/install-dotnet@533307d1c90c37993c8ef1397388bc9783e7b87c
4747
with:
48-
global-json: global.json
48+
global-json: global.json
49+
50+
- name: Wait for packages to be available
51+
if: github.run_id != inputs.run-id
52+
shell: pwsh
53+
env:
54+
GH_TOKEN: ${{ github.token }}
55+
RUN_ID: ${{ inputs.run-id }}
56+
run: |
57+
while ($true)
58+
{
59+
$conclusion = gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" `
60+
"/repos/${{ github.repository }}/actions/runs/$(env:RUN_ID)" `
61+
| ConvertFrom-Json `
62+
| % { $_.conclusion }
63+
if ($null -ne $conclusion)
64+
{
65+
if ($conclusion -ne "success")
66+
{
67+
echo "Build had conclusion '$conclusion'. Failing.";
68+
exit 1;
69+
}
70+
else
71+
{
72+
echo "Build succeeded. Continuing."
73+
exit 0;
74+
}
75+
}
76+
Start-Sleep -Seconds 30;
77+
}
4978
5079
- name: Download compiled packages
5180
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)