From 188cce892a14a496a71a219096dc2e85c1e4b541 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 28 Nov 2024 13:10:19 +0100 Subject: [PATCH] Fix parent caching The for loop wasn't splitting. Use proper bash arrays. --- .github/workflows/build-ruby.yml | 64 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index bf1bd85..b6a78f7 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -240,8 +240,8 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -250,8 +250,8 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -271,8 +271,8 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -281,8 +281,8 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -302,8 +302,8 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -312,8 +312,8 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -333,8 +333,8 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -343,8 +343,8 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -360,8 +360,8 @@ jobs: - name: Push CI run image (${{ join(matrix.arch, ', ') }}) run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -369,8 +369,8 @@ jobs: - name: Push commit image (${{ join(matrix.arch, ', ') }}) run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -379,8 +379,8 @@ jobs: if: ${{ inputs.push }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -391,8 +391,8 @@ jobs: if: ${{ inputs.push && matrix.libc == 'gnu' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -403,8 +403,8 @@ jobs: if: ${{ matrix.libc == 'gnu' || matrix.libc == 'centos' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -413,8 +413,8 @@ jobs: if: ${{ inputs.push && (matrix.libc == 'gnu' || matrix.libc == 'centos') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -429,8 +429,8 @@ jobs: if: ${{ matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done @@ -441,8 +441,8 @@ jobs: if: ${{ inputs.push && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done