Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove set-output usage #337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
id: info
run: |
if [ '${{ github.event_name }}' = 'pull_request' ]; then
echo '::set-output name=commit_message::'
echo "commit_message=" >> $GITHUB_ENV

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and all the others are actually echo 'name=commit_message' >> $GITHUB_OUTPUT
reference: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

exit 0
fi
echo '::set-output name=commit_message::[auto]'
echo "commit_message=[auto]" >> $GITHUB_ENV

- uses: satackey/push-prebuilt-action@v0.2.0-beta3
with:
commit-message: ${{ steps.info.outputs.commit_message }}
commit-message: ${{ env.commit_message }}
push-branch: '{branch}-release'

- uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -127,10 +127,11 @@ jobs:

- run: ${{ matrix.prepare_command }}

- name: Extract
id: extract
run: |
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
# FIXME: I don't think this is used? Looks like syntax for another build system?
# - name: Extract
# id: extract
# run: |
# echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one. Doesn't look like it actually does anything useful?


- name: Download action
uses: actions/download-artifact@v2
Expand All @@ -149,21 +150,19 @@ jobs:
run: docker inspect ${{ matrix.inspect_image }}

- name: Get cached image ID
run: echo ::set-output name=id::$(docker image ls -q ${{ matrix.inspect_image }})
id: cached
run: echo "CACHED_ID=$(docker image ls -q ${{ matrix.inspect_image }})" >> $GITHUB_ENV

- run: ${{ matrix.build_command }}

- name: Show built image info
run: docker inspect ${{ matrix.inspect_image }}

- name: Show built image ID
run: echo ::set-output name=id::$(docker image ls -q ${{ matrix.inspect_image }})
id: latest
run: echo "LATEST_ID=$(docker image ls -q ${{ matrix.inspect_image }})" >> $GITHUB_ENV

- name: Compare cached ID and after build ID
run: |
if [ ! '${{ steps.cached.outputs.id }}' = '${{ steps.latest.outputs.id }}' ];then
if [ ! '${{ env.CACHED_ID }}' = '${{ env.LATEST_ID }}' ];then
echo cached != latest
exit 1
fi
8 changes: 3 additions & 5 deletions .github/workflows/test_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,19 @@ jobs:
run: docker inspect ${{ matrix.inspect_image }}

- name: Get cached image ID
run: echo ::set-output name=id::$(docker image ls -q ${{ matrix.inspect_image }})
id: cached
run: echo "CACHED_ID=$(docker image ls -q ${{ matrix.inspect_image }})" >> $GITHUB_ENV

- run: ${{ matrix.build_command }}

- name: Show built image info
run: docker inspect ${{ matrix.inspect_image }}

- name: Show built image ID
run: echo ::set-output name=id::$(docker image ls -q ${{ matrix.inspect_image }})
id: latest
run: echo "LATEST_ID=$(docker image ls -q ${{ matrix.inspect_image }})" >> $GITHUB_ENV

- name: Compare cached ID and after build ID
run: |
if [ ! '${{ steps.cached.outputs.id }}' = '${{ steps.latest.outputs.id }}' ];then
if [ ! '${{ env.CACHED_ID }}' = '${{ env.LATEST_ID }}' ];then
echo cached != latest
exit 1
fi