我有以下 github 操作,我收到以下警告:
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/
但我没有使用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
最佳答案
由于您的工作流程未使用set-output
,因此您需要查看外部操作依赖项。它们之一或两者都使用过时的语法。
对于基于 JS 的操作,@actions/core
添加了对 1.10.0 中输出环境文件的支持
tyankatsu0105/read-package-version-actions@v1
此操作的 v1 于 2019 年发布,因此毫无疑问这是您问题的根源之一。它确实使用 set-output ,但是来自旧版本的@actions/core
。
您还可能收到有关 node 12 的警告弃用。
ncipollo/release-action@v1
。
此操作的最新更新于 2022 年 12 月,在节点 16 上运行,使用 set-output ,但有 correct version @actions/core
。
基于此,#1 是您的问题操作。现在,您有几个选择,添加请求更新的问题,提交包含必要更改的 PR,或者找到支持您需求的最新操作。
关于Github 操作 `set-output` 命令已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75972484/