在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
相关产品推荐
相关产品推荐

