Replace set-output commands with GITHUB_OUTPUT environment vars (#2192)

The set-output commands via stdout are deprecated. Use the GITHUB_OUTPUT
environment variable as suggested by GitHub.
This commit is contained in:
Stefan Agner 2022-10-17 14:32:41 +02:00 committed by GitHub
parent 4c31c47a98
commit 3d763f1d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,7 @@ jobs:
run: | run: |
version_dev="dev$(date --utc +'%Y%m%d')" version_dev="dev$(date --utc +'%Y%m%d')"
echo "Development version \"${version_dev}\"" echo "Development version \"${version_dev}\""
echo "::set-output name=version_dev::${version_dev}" echo "version_dev=${version_dev}" >> $GITHUB_OUTPUT
- name: Generate Development build version for PR - name: Generate Development build version for PR
if: ${{ github.event.pull_request }} if: ${{ github.event.pull_request }}
shell: bash shell: bash
@ -34,14 +34,14 @@ jobs:
run: | run: |
version_pr=$(printf "%05d" ${{ github.event.pull_request.number }}) version_pr=$(printf "%05d" ${{ github.event.pull_request.number }})
echo "Development build for PR #${{ github.event.pull_request.number }}" echo "Development build for PR #${{ github.event.pull_request.number }}"
echo "::set-output name=version_pr::${version_pr}" echo "version_pr=${version_pr}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get Major/Minor version - name: Get Major/Minor version
id: version_main id: version_main
run: | run: |
major=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_MAJOR | cut -d'=' -f2) major=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_MAJOR | cut -d'=' -f2)
build=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_BUILD | cut -d'=' -f2) build=$(cat ${GITHUB_WORKSPACE}/buildroot-external/meta | grep VERSION_BUILD | cut -d'=' -f2)
echo "::set-output name=version_main::${major}.${build}" echo "version_main=${major}.${build}" >> $GITHUB_OUTPUT
- name: Create build matrix - name: Create build matrix
uses: actions/github-script@v6 uses: actions/github-script@v6
id: generate_matrix id: generate_matrix

View File

@ -29,12 +29,11 @@ jobs:
exit 1 exit 1
fi fi
if [ "" != "${tag_dev}" ]; then if [ "" != "${tag_dev}" ]; then
echo "Note: Release build with custom dev part: ${tag_dev}." echo "version=${major}.${build}.${tag_dev}" >> $GITHUB_OUTPUT
echo "::set-output name=version::${major}.${build}.${tag_dev}"
else else
echo "::set-output name=version::${major}.${build}" echo "version=${major}.${build}" >> $GITHUB_OUTPUT
fi fi
echo "::set-output name=version_dev::${tag_dev}" echo "version_dev=${tag_dev}" >> $GITHUB_OUTPUT
- name: Create build matrix - name: Create build matrix
uses: actions/github-script@v6 uses: actions/github-script@v6
id: generate_matrix id: generate_matrix