Skip to content

Commit

Permalink
cicd: update usage of set-output
Browse files Browse the repository at this point in the history
  • Loading branch information
hdonnay committed Dec 9, 2022
1 parent a8a97f8 commit aff17a4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aff17a4

Please sign in to comment.