You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitHub Actions部署Dev环境遇set-output/Node12弃用警告求助

GitHub Actions Dev环境部署警告修复方案

问题分析

你遇到的两个警告均源于使用了依赖已废弃功能或运行时的旧版GitHub Actions组件,只需升级对应Action版本即可解决。

具体修改步骤

  1. 解决node12运行时警告
    将microsoft/setup-msbuild@v1.0.2替换为最新稳定版microsoft/setup-msbuild@v2,新版本已适配node16+运行时。

  2. 解决set-output命令废弃警告
    升级以下两个Action到最新版本,新版本已移除对set-output的依赖:

    • 将azure/login@v1升级为azure/login@v2
    • 将Azure/sql-action@v2.1升级为Azure/sql-action@v3

修改后的完整工作流YAML

# This is a basic workflow to deploy Azure SQL Database

name: Azure SQL Deploy DEV

# Controls when the workflow will run
on:
  workflow_dispatch:

  
permissions:
  id-token: write
  contents: read

jobs:
  # This workflow contains a single job called "build-and-release"
  build_and_release:
    # The type of runner that the job will run on
    runs-on: windows-latest

    steps:
      - uses: actions/checkout@v3
    
      - name: Add msbuild to PATH
        uses: microsoft/setup-msbuild@v2
        
      # create dacpac using MSBUILD
      - name: Build dacpac for Database Project
        run: |
          msbuild.exe 'az-pl-dwh/main-dev/sql-server/sql-db-dwh-pl-dev/sql-db-dwh-pl.sqlproj' /p:Configuration=Release

    # Login to Azure for access to Azure Container Registry
      - name: OIDC Login to Azure Public Cloud with AzPowershell (enableAzPSSession true)
        uses: azure/login@v2
        with:
            client-id: ${{ ****}}
            tenant-id: ${{ ****}}
            subscription-id: ${{ ****}}
            enable-AzPSSession: true

      - uses: Azure/sql-action@v3
        with:
            connection-string: 'Server=tcp:sql-alz-ox-dwh-dev.database.windows.net,1433;Initial Catalog=sql-db-alz-ox-dwh-oxbo;Authentication=Active Directory Default; Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;'
            # Use the dacpac file from the build job and deploy it to the DEV database
            path: 'az-pl-dwh/main-dev/sql-server/sql-db-dwh-pl-dev/bin/Release/sql-db-dwh-pl.dacpac'
            action: 'Publish'
            build-arguments: '-c Release'                 
            arguments: '/p:DropObjectsNotInSource=true /p:DropPermissionsNotInSource=false /p:DropRoleMembersNotInSource=false /p:ExcludeObjectTypes=Users;DatabaseRoles;Permissions;RoleMembership /p:BlockOnPossibleDataLoss=false'

验证说明

修改后重新触发部署,两个警告应会消失。若后续仍出现类似警告,检查其他Action是否需升级至最新版本即可。

内容的提问来源于stack exchange,提问作者Ebelly

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 16:01:31