Skip to content

Commit 4c92d33

Browse files
Update release-ghcr.yaml
Add wait-for-hydra logic, so we don't attempt to upload images before hydra is done. Co-authored-by: Andrea Bedini <[email protected]>
1 parent 3dc292b commit 4c92d33

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/release-ghcr.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,34 @@ on:
1616
env:
1717
# Only to avoid some repetition
1818
FLAKE_REF: github:${{ github.repository }}/${{ github.ref_name }}
19+
GH_TOKEN: ${{ github.token }}
1920
# We need to tell skopeo where to write the authentication token
2021
REGISTRY_AUTH_FILE: ./skopeo-registry-auth-file.json
2122

2223
jobs:
24+
wait-for-hydra:
25+
name: "Wait for hydra check-runs"
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Waiting for ci/hydra-build:required to complete
29+
run: |
30+
while [[ true ]]; do
31+
conclusion=$(gh api repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs --jq '.check_runs[] | select(.name == "ci/hydra-build:required") | .conclusion')
32+
case "$conclusion" in
33+
success)
34+
echo "ci/hydra-build:required succeeded"
35+
exit 0;;
36+
failure)
37+
echo "ci/hydra-build:required failed"
38+
exit 1;;
39+
*)
40+
echo "ci/hydra-build:required pending. Waiting 30s..."
41+
sleep 30;;
42+
esac
43+
done
44+
2345
build:
46+
needs: [wait-for-hydra]
2447
name: "Upload to ghcr.io"
2548
runs-on: ubuntu-latest
2649
steps:

0 commit comments

Comments
 (0)