2

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
Paul
  • 3,644
  • 9
  • 47
  • 113

3 Answers3

2

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.0

  1. tyankatsu0105/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.

  1. 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.

aknosis
  • 3,602
  • 20
  • 33
0

But I'm not using set-output.

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.

hakre
  • 193,403
  • 52
  • 435
  • 836
0

As already mentioned by others above, the "set-output command is deprecated" warning is now showing on various Github Actions where Actions maintainers haven't updated their repos to address this recent change in Github workflow yet (https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/). Another warning - 'Node.js 12 actions are deprecated' - is also triggered for most of these Github Actions for a similar reason (see https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ for details). For instance, I am currently facing the same issue with FirebaseExtended/action-hosting-deploy feature.

I checked the repo for tyankatsu0105/read-package-version-actions@v1 that apparently triggers the warning in your case and found the relevant issue already open for this repo: https://github.com/tyankatsu0105/read-package-version-actions/issues/15

So, if you keep using this Github Action, to get rid of this warning you should probably reach out to the Action maintainer (@tyankatsu0105) on Github asking them to resolve this issue, or create a PR on Github fixing the redundant dependencies to tyankatsu0105/read-package-version-actions@v1 yourself asking the Action maintainer to merge it.

Nikita Kalganov
  • 541
  • 4
  • 7
  • Just for you to know, a similar issue on FirebaseExtended/action-hosting-deploy has been fixed, so the warning about set-output command doesn't show there anymore. Here's the link to the fix https://github.com/FirebaseExtended/action-hosting-deploy/pull/279. Thus I advise users of tyankatsu0105/read-package-version-actions to reach out to the Action maintainer on Github and suggest a similar fix. – Nikita Kalganov May 17 '23 at 11:52