From 2cc0c8e95ee5ab70cf6fafffc40defff8419d4e0 Mon Sep 17 00:00:00 2001 From: renner <80410025+renner0e@users.noreply.github.com> Date: Thu, 11 Jun 2026 22:14:17 +0200 Subject: [PATCH] feat(ci): add retries for registry logins (#2369) The retry function is lifted straight from our base images [1]. Shold make CI flakes a little less likely [2] as seen in [3]. [1]: https://forge.fedoraproject.org/atomic-desktops/config/src/commit/8301eaad962065b653df30cce9658021df1c24f2/justfile#L33-L53 [2]: https://github.com/ublue-os/aurora/issues/2337 [3]: https://github.com/ublue-os/aurora/actions/runs/27338439302/job/80768647685 --- .github/workflows/reusable-build.yml | 7 ++++--- Justfile | 31 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index eb9e905b..38b4bb9c 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -323,8 +323,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_ACTOR: ${{ github.actor }} run: | - echo "${GITHUB_TOKEN}" | podman login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + just login-registry podman ghcr.io + # cosign gets credentials from docker + just login-registry docker ghcr.io # Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR. # https://github.com/macbre/push-to-ghcr/issues/12 @@ -396,7 +397,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_ACTOR: ${{ github.actor }} run: | - echo "${GITHUB_TOKEN}" | oras login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin + just login-registry oras ghcr.io - name: Upload SBOM if: inputs.publish diff --git a/Justfile b/Justfile index b2f12c25..2ffb695e 100644 --- a/Justfile +++ b/Justfile @@ -34,6 +34,28 @@ export PODMAN := if path_exists("/usr/bin/podman") == "true" { env("PODMAN", "/u export PULL_POLICY := if PODMAN =~ "docker" { "missing" } else { "newer" } just := just_executable() +# Define a retry function for use in recipes +retry_function := ' +retry() { + if [[ "${#}" -lt 3 ]]; then + echo "retry usage: