Skip to content

Fix GitHub Actions deprecation warning for set-output command#7

Merged
bookernath merged 2 commits into
mainfrom
copilot/fix-01edcd33-c269-46ec-87e2-d5493c922141
Aug 31, 2025
Merged

Fix GitHub Actions deprecation warning for set-output command#7
bookernath merged 2 commits into
mainfrom
copilot/fix-01edcd33-c269-46ec-87e2-d5493c922141

Conversation

Copilot AI commented Aug 31, 2025

Copy link
Copy Markdown
Contributor

Problem

The repository was generating deprecation warnings during GitHub Actions workflow runs due to the use of the deprecated ::set-output command:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Root Cause

The warning was caused by the actions/create-release@v1 action in the release workflow, which internally uses the deprecated ::set-output command. This action has been deprecated and is no longer maintained.

Solution

Replaced the deprecated actions/create-release@v1 action with the modern GitHub CLI (gh) approach:

Before:

- name: Create GitHub Release
  uses: actions/create-release@v1
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    tag_name: v${{ env.NEW_VERSION }}
    release_name: Release v${{ env.NEW_VERSION }}
    body: |
      ## Changes in v${{ env.NEW_VERSION }}
      ...
    draft: false
    prerelease: ${{ contains(env.NEW_VERSION, '-') }}

After:

- name: Create GitHub Release
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    # Create release notes
    cat > release_notes.md << 'EOF'
    ## Changes in v${{ env.NEW_VERSION }}
    ...
    EOF
    
    # Create the release
    if [[ "${{ env.NEW_VERSION }}" == *"-"* ]]; then
      gh release create "v${{ env.NEW_VERSION }}" \
        --title "Release v${{ env.NEW_VERSION }}" \
        --notes-file release_notes.md \
        --prerelease
    else
      gh release create "v${{ env.NEW_VERSION }}" \
        --title "Release v${{ env.NEW_VERSION }}" \
        --notes-file release_notes.md
    fi

Benefits

  • ✅ Eliminates the deprecation warning completely
  • ✅ Uses modern, actively maintained GitHub CLI
  • ✅ Maintains identical functionality including prerelease detection
  • ✅ No additional dependencies (GitHub CLI is pre-installed in runners)
  • ✅ More direct API interaction without deprecated intermediary actions

Testing

  • Verified YAML syntax is valid
  • Confirmed all existing functionality is preserved
  • Validated that no other deprecated commands remain in the workflows
  • Ensured build and test processes continue to work correctly

This change future-proofs the release workflow by removing the last deprecated GitHub Actions command usage.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: bookernath <8922457+bookernath@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the github action to accommodate this deprecation "The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprec... Fix GitHub Actions deprecation warning for set-output command Aug 31, 2025
Copilot AI requested a review from bookernath August 31, 2025 02:47
@bookernath
bookernath marked this pull request as ready for review August 31, 2025 04:08
@bookernath
bookernath merged commit 7c5403b into main Aug 31, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants