diff --git a/.github/scripts/fetch-modified-images.sh b/.github/scripts/fetch-modified-images.sh new file mode 100755 index 00000000..f089138a --- /dev/null +++ b/.github/scripts/fetch-modified-images.sh @@ -0,0 +1,17 @@ +# Gets changed images from GIT + +set -euo pipefail + + +declare -a changes_array=() +while read -r app +do + while read -r channel + do + change="$(jo app="$app" channel="$channel")" + changes_array+=($change) + done < <(jq -e --raw-output -c '.channels[] | .name' "./apps/$app/metadata.json") +done < <(echo '${{ needs.pr-metadata.outputs.addedOrModifiedImages }}' | jq -e --raw-output -c '.[]') + +output="$(jo -a ${changes_array[*]})" +echo "::set-output name=changes::${output}" diff --git a/.github/workflows/image-rebuild.yaml b/.github/workflows/image-rebuild.yaml index 9d07d7ce..85e6bf3d 100644 --- a/.github/workflows/image-rebuild.yaml +++ b/.github/workflows/image-rebuild.yaml @@ -44,19 +44,7 @@ jobs: - name: Fetch modified images id: get-changed shell: bash - run: | - declare -a changes_array=() - while read -r app - do - while read -r channel - do - change="$(jo app="$app" channel="$channel")" - changes_array+=($change) - done < <(jq -r '.channels[] | .name' "./apps/$app/metadata.json") - done < <(echo '${{ needs.get-changes.outputs.addedOrModifiedImages }}' | jq --raw-output -c '.[]') - - output="$(jo -a ${changes_array[*]})" - echo "::set-output name=changes::${output}" + run: ./.github/scripts/fetch-modified-images.sh images-build: uses: cdloh/containers/.github/workflows/action-image-build.yaml@main diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml index ebf017a9..6b938f73 100644 --- a/.github/workflows/pr-validate.yaml +++ b/.github/workflows/pr-validate.yaml @@ -34,19 +34,7 @@ jobs: - name: Fetch modified images id: get-changed shell: bash - run: | - declare -a changes_array=() - while read -r app - do - while read -r channel - do - change="$(jo app="$app" channel="$channel")" - changes_array+=($change) - done < <(jq --raw-output -c '.channels[] | .name' "./apps/$app/metadata.json") - done < <(echo '${{ needs.pr-metadata.outputs.addedOrModifiedImages }}' | jq --raw-output -c '.[]') - - output="$(jo -a ${changes_array[*]})" - echo "::set-output name=changes::${output}" + run: ./.github/scripts/fetch-modified-images.sh images-build: uses: cdloh/containers/.github/workflows/action-image-build.yaml@main diff --git a/apps/calibre/metadata.json b/apps/calibre/metadata.json index 91c7cc60..06c4cfb6 100644 --- a/apps/calibre/metadata.json +++ b/apps/calibre/metadata.json @@ -22,7 +22,7 @@ ], "stable": true, "tests": { - "enabled": false, + "enabled": false,fd } } ]