I have the following github action, I am given the following warnings:
build-android
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/
But I’m not using set-output
.
on: workflow_dispatch
name: Build
jobs:
build-android:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Install npm dependencies
run: npm install
- name: Build Android Release
run: cd android && ./gradlew assembleRelease
- name: Read package.json
uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: app-release.apk
path: android/app/build/outputs/apk/release/
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
artifacts: "android/app/build/outputs/apk/release/app-release.apk"
tag: "v${{ steps.package-version.outputs.version }}"
replacesArtifacts: false
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
2
Answers
Luckily we don’t fight over a beer for that statement, but if you remove step-by-step from behind and execute per each removal, you’ll identify which step removal removes the warning.
Then find the
uses
statement of the removal and check for updates. Also report the issue if not yet reported. Restore, update and re-try.TLDR:
uses
uses other uses, too. Check all actions in use for updates. If a culprit and no updates, prepare for replacement.Since your workflow is not using
set-output
, then you need to look at your external action dependencies. One or both of them are using the outdated syntax.For JS based actions,
@actions/core
added support for output env files in 1.10.0tyankatsu0105/read-package-version-actions@v1
v1 of this action was released in 2019, so undoubtedly this is one source of your problems. It does use set-output, but from the old version of the
@actions/core
.You are also likely getting a warning about node 12 deprecation.
ncipollo/release-action@v1
.This action’s latest update was in December 2022, is running on node 16, is using set-output, but has the correct version of
@actions/core
.Based on this, #1 is your problem action. Now you have a few choices, add an issue requesting an update, submit a PR with the necessary changes, or find a different action that supports your needs that is more up to date.