From aff17a4a3e2c9288baa69a1b9bee0b2e6318d276 Mon Sep 17 00:00:00 2001 From: Hank Donnay Date: Fri, 9 Dec 2022 11:17:25 -0600 Subject: [PATCH] cicd: update usage of `set-output` See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Signed-off-by: Hank Donnay --- .github/workflows/config-ci.yml | 2 +- .github/workflows/cut-release.yml | 16 +++++++++------- .github/workflows/main.yml | 2 +- .github/workflows/nightly.yml | 16 +++++++++------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/config-ci.yml b/.github/workflows/config-ci.yml index 8d69214ae4..0b1b515aad 100644 --- a/.github/workflows/config-ci.yml +++ b/.github/workflows/config-ci.yml @@ -23,7 +23,7 @@ jobs: steps: - id: config run: | - echo '::set-output name=go_versions::["1.17", "1.18", "1.19"]' + echo 'go_versions=["1.17", "1.18", "1.19"]' >> "$GITHUB_OUTPUT" commit-check: name: Commit Check diff --git a/.github/workflows/cut-release.yml b/.github/workflows/cut-release.yml index 2e76af4d94..7dfa4888e6 100644 --- a/.github/workflows/cut-release.yml +++ b/.github/workflows/cut-release.yml @@ -33,13 +33,15 @@ jobs: : "${tag:="$(basename "${GITHUB_REF}")"}" : "${repo:=$GITHUB_REPOSITORY}" test "${GITHUB_REPOSITORY_OWNER}" = quay && repo="projectquay/${GITHUB_REPOSITORY##*/}" ||: - printf '::set-output name=version::%s\n' "$tag" - printf '::set-output name=tar_prefix::%s\n' "clair-${tag}/" - printf '::set-output name=image_tag::%s\n' "${tag#v}" - printf '::set-output name=image_repo::%s\n' "${repo}" - printf '::set-output name=build_image::%s\n' '${{ matrix.image }}' - printf '::set-output name=build_go_version::%s\n' "$(go version | cut -f 3 -d ' ' | sed 's/^go//;s/\.[0-9]\+$//')" - printf '::set-output name=cache_key::%s\n' "$(go version | md5sum - | cut -f 1 -d ' ')" + cat <<. >>"$GITHUB_OUTPUT" + version=$tag + tar_prefix=clair-${tag}/ + image_tag=${tag#v} + image_repo=${repo} + build_image=${{ matrix.image }} + build_go_version=$(go version | cut -f 3 -d ' ' | sed 's/^go//;s/\.[0-9]\+$//') + cache_key=$(go version | md5sum - | cut -f 1 -d ' ') + . release-archive: name: Create Release Archive diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c25b9b0816..7f10d7a5d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: steps: - id: config run: | - echo '::set-output name=go_versions::["1.17", "1.18", "1.19"]' + echo 'go_versions=["1.17", "1.18", "1.19"]' >> "$GITHUB_OUTPUT" commit-check: name: Commit Check diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 51bb0db25b..2873e5971c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,13 +33,15 @@ jobs: gv=$(test -n "${{github.event.inputs.go_version}}" && echo "${{github.event.inputs.go_version}}" || echo 1.18) : "${repo:=$GITHUB_REPOSITORY}" test "${repo%%/*}" = quay && repo="projectquay/${repo##*/}" ||: - printf '::set-output name=push::%s\n' "${{ env.QUAY_TOKEN != '' }}" - printf '::set-output name=api::%s\n' "${{ env.QUAY_API_TOKEN != '' }}" - printf '::set-output name=date::%s\n' "$(date -u '+%Y-%m-%d')" - printf '::set-output name=tag::%s\n' "$(test -n "${{github.event.inputs.tag}}" && echo "${{github.event.inputs.tag}}" || echo nightly)" - printf '::set-output name=claircore_branch::%s\n' "${br}" - printf '::set-output name=go_version::%s\n' "${gv}" - printf '::set-output name=repo::%s\n' "${repo}" + cat <<. >>$GITHUB_OUTPUT + push=${{ env.QUAY_TOKEN != '' }} + api=${{ env.QUAY_API_TOKEN != '' }} + date=$(date -u '+%Y-%m-%d') + tag=$(test -n "${{github.event.inputs.tag}}" && echo "${{github.event.inputs.tag}}" || echo nightly) + claircore_branch=${br} + go_version=${gv} + repo=${repo} + . # Environment variables printf 'CLAIRCORE_BRANCH=%s\n' "${br}" >> $GITHUB_ENV printf 'GO_VERSION=%s\n' "$gv" >> $GITHUB_ENV