Skip to content

Commit

Permalink
Replace deprecate GH set-output command
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Nov 13, 2022
1 parent 3fdd811 commit 1fdbcf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 65 deletions.
24 changes: 0 additions & 24 deletions actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,10 @@ outputs:
sonar:
description: ''
value: ${{ steps.setup.outputs.sonar }}
java-matrix:
description: ''
value: ${{ steps.setup.outputs.java-matrix }}
java-default:
description: ''
value: ${{ steps.setup.outputs.java-default }}
java-distribution-matrix:
description: ''
value: ${{ steps.setup.outputs.java-distribution-matrix }}
java-distribution-default:
description: ''
value: ${{ steps.setup.outputs.java-distribution-default }}

runs:
using: "composite"
steps:
- uses: actions/[email protected]
with:
persist-credentials: false

- name: Read preoject environemnts
shell: bash
run: |
if [ -f .github/build.env ]; then
echo "Use project build.env"
grep -e "^[A-Z_]\+=[0-9a-zA-Z\., \"\-]\+$" .github/build.env >> $GITHUB_ENV;
fi
- name: Set outputs
shell: bash
id: setup
Expand Down
46 changes: 5 additions & 41 deletions actions/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,22 @@
echo "::group::Setup preparing"

SONAR=$(echo "MmRlMGUzMmIyYjMxMDg5NjVmNzZhNDcxM2JhMjAyODk3OGMyMzNlZAo=" | openssl base64 -d)
echo "sonar=${SONAR}" >> $GITHUB_OUTPUT

echo "::set-output name=sonar::${SONAR}"

if [ -z "${DATE_YM}" ]; then
DATE_YM=$(date +%y%m)
fi

echo "::set-output name=date-ym::${DATE_YM}"
DATE_YM=$(date +%y%m)
echo "date-ym=${DATE_YM}" >> $GITHUB_OUTPUT
echo "date-ym=${DATE_YM}"

if [ -z "${GITHUB_REF##*heads*}" ]; then
BRANCH=${GITHUB_REF#refs/heads/}
echo "::set-output name=branch::${BRANCH}"
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo "branch=${BRANCH}"
fi

if [ -z "${GITHUB_REF##*tags*}" ]; then
TAG=${GITHUB_REF#refs/tags/}
echo "::set-output name=tag::${TAG}"
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "tag=${TAG}"
fi

# java versions

if [ -z "${JAVA_DEFAULT}" ]; then
JAVA_DEFAULT='8'
fi

echo "::set-output name=java-default::${JAVA_DEFAULT}"
echo "java-default=${JAVA_DEFAULT}"

if [ -z "$JAVA_MATRIX" ]; then
JAVA_MATRIX='"8", "11", "17"'
fi

echo "::set-output name=java-matrix::[${JAVA_MATRIX}]"
echo "java-matrix=[${JAVA_MATRIX}]"

# java distribution

if [ -z "${JAVA_DISTRIBUTION_DEFAULT}" ]; then
JAVA_DISTRIBUTION_DEFAULT='zulu'
fi

echo "::set-output name=java-distribution-default::${JAVA_DISTRIBUTION_DEFAULT}"
echo "java-distribution-default=${JAVA_DISTRIBUTION_DEFAULT}"

if [ -z "$JAVA_DISTRIBUTION_MATRIX" ]; then
JAVA_DISTRIBUTION_MATRIX='"zulu"'
fi

echo "::set-output name=java-distribution-matrix::[${JAVA_DISTRIBUTION_MATRIX}]"
echo "java-distribution-matrix=[${JAVA_DISTRIBUTION_MATRIX}]"

echo "::endgroup::"

0 comments on commit 1fdbcf4

Please sign in to comment.