Fix set-output command deprecated in gh actions

This commit is contained in:
Carlos Giraldo
2024-01-29 12:21:54 +01:00
parent 9ddf948279
commit 05507ce1b3
3 changed files with 11 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ jobs:
id: generate-matrix
run: |
changed=`echo "${{ steps.files.outputs.all_changed_files }}" | sed 's/ /\n/g' | grep $images_dir | cut -f2 -d'/' | uniq | sed 's/^/"/;s/$/"/' | sed -z 's/\n/,/g;s/,$/\n/'`
echo "::set-output name=matrix::{ \"image\": [ ${changed} ] }"
echo "matrix={ \"image\": [ ${changed} ] }" >> $GITHUB_OUTPUT
# build image if changes in code
build-image:
@@ -45,9 +45,9 @@ jobs:
id: image-info
run: |
source ./images/${{ matrix.image }}/image_info.sh
echo "::set-output name=platforms::$PLATFORMS"
echo "::set-output name=image_tag::$IMAGE_TAG"
echo "::set-output name=image::${{ matrix.image }}"
echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "image=${{ matrix.image }}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

View File

@@ -24,7 +24,7 @@ jobs:
id: generate-matrix
run: |
IMAGES=$( ls -1 ${{ env.IMAGES_DIR }} | tr '\n' ',' | sed 's/[^,]\+/"\0"/g;s/,$//' )
echo "::set-output name=matrix::{ \"image\": [ ${IMAGES} ] }"
echo "matrix={ \"image\": [ ${IMAGES} ] }" >> $GITHUB_OUTPUT
# ---
# Update the version of the existing images when possible and launch pull request
@@ -46,11 +46,10 @@ jobs:
id: update_tag
run: |
cd ${{ env.IMAGE_DIR }}
echo "::set-output name=old-version::$( sed -n '/IMAGE_TAG/s/^.*=//p' image_info.sh || echo 'NOT_FOUND' )"
echo "old-version=$( sed -n '/IMAGE_TAG/s/^.*=//p' image_info.sh || echo 'NOT_FOUND' )" >> $GITHUB_OUTPUT
[[ -f ./update_current_tag.sh ]] && ./update_current_tag.sh
echo "::set-output name=new-version::$( sed -n '/IMAGE_TAG/s/^.*=//p' image_info.sh || echo 'NOT_FOUND' )"
echo "new-version=$( sed -n '/IMAGE_TAG/s/^.*=//p' image_info.sh || echo 'NOT_FOUND' )" >> $GITHUB_OUTPUT
continue-on-error: true
# Launch Pull Request only when the version is updated

View File

@@ -29,7 +29,7 @@ jobs:
id: generate-matrix
run: |
changed=`echo "${{ steps.files.outputs.all_changed_files }}" | sed 's/ /\n/g' | grep $images_dir | cut -f2 -d'/' | uniq | sed 's/^/"/;s/$/"/' | sed -z 's/\n/,/g;s/,$/\n/'`
echo "::set-output name=matrix::{ \"image\": [ ${changed} ] }"
echo "matrix={ \"image\": [ ${changed} ] }" >> $GITHUB_OUTPUT
# build image if changes in code
build-image:
@@ -46,9 +46,9 @@ jobs:
id: image-info
run: |
source ./images/${{ matrix.image }}/image_info.sh
echo "::set-output name=platforms::$PLATFORMS"
echo "::set-output name=image_tag::$IMAGE_TAG"
echo "::set-output name=image::${{ matrix.image }}"
echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "image=${{ matrix.image }}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v1