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

在GHES上执行GitHub流水线时遇upload-artifact@v4不支持错误

解决GHES上upload-artifact@v4不支持的错误

错误提示明确说明GHES(GitHub Enterprise Server)当前不兼容@actions/artifact v2.0.0+及upload-artifact@v4+版本,直接有效的解决方式是将actions/upload-artifact的版本降级到v3,该版本适配GHES环境。

修改你的工作流配置,仅需将上传产物步骤的版本从@v4改为@v3:

name: Playwright Tests
on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
jobs:
  test:
    timeout-minutes: 60
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
      with:
        node-version: 22.11.0
    - name: Install dependencies
      run: npm ci
    - name: Install Playwright Browsers
      run: npx playwright install --with-deps
    - name: Run Playwright tests
      run: npm test
    - uses: actions/upload-artifact@v3  # 此处修改为v3版本
      if: always()
      with:
        name: Reports
        path: test-results/
        retention-days: 30

v3版本的upload-artifact同样支持retention-days参数,其他配置无需调整。修改后重新触发流水线,即可正常完成测试并上传测试报告。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.15 16:48:15