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: