--migrate-local-actions makes jobs download the whole repository archive, which times out in large repositories

Đang mở
#268 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, github-actions, go
Lĩnh vực
cli, devtools

Hướng nghiên cứu

Start by reading the README troubleshooting section for local-action and the help text for --migrate-local-actions; the issue names these as documentation targets. Then trace how local actions are migrated and how workflow dependencies are recorded. Done means documenting the archive download trade-off and adding an option that keeps ./ while recording the action’s remote dependencies; the optional repository size warning is separate.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

After running gh actions-lock --migrate-local-actions in our large private repository, every job that uses a migrated $/… action fails in "Set up job". The runner seems to download an archive of the whole repository at the workflow's commit just to get a composite action under .github/actions/, and the download times out:

Using locked action versions from the workflow's lockfile
##[warning]Failed to download action 'https://codeload.github.com/<owner>/<repo>/tar.gz/<sha>'. Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
##[warning]Failed to download action 'https://codeload.github.com/<owner>/<repo>/tar.gz/<sha>'. Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
##[error]Action 'https://codeload.github.com/<owner>/<repo>/tar.gz/<sha>' download has timed out. Error: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
##[error]Failed to download archive 'https://codeload.github.com/<owner>/<repo>/tar.gz/<sha>' after 3 attempts.
  • It happens on both GitHub-hosted (ubuntu-slim) and self-hosted (Windows, runner v2.338.2) runners.
  • In the same PR, jobs that only use remote actions ran fine with the lockfile. Only jobs with $/ actions failed.
  • Environment: gh-actions-lock v0.4.1, github.com.

I know the download itself happens in the runner, not in this extension. I'm filing it here because the extension and the docs steer users toward --migrate-local-actions, and for a large repository that makes the workflows unusable. The other option, --ignore-local-actions, needs a hand-written if: false stub in every affected workflow.

Requests:

  1. Document the trade-off. In the README, the troubleshooting local-action section, and the --migrate-local-actions help, say that a $/ action is fetched from a repository archive at the workflow's commit, so large repositories can be slow or time out.
  2. Keep ./ but lock what the in-repo action uses. Add an option that keeps uses: ./…, reads the action's action.yml from the repository at lock time, and records its remote dependencies as entries for the calling workflow. That would automate the documented if: false stub workaround. I understand that ./ resolves against the runner's workspace, so this is weaker than $/. For repositories where $/ isn't practical, it would still be much easier to maintain than hand-written stubs.
  3. (Optional) Warn when migrating in a large repository. For example, warn during --migrate-local-actions when the repository size reported by the API is large.

Related discussion: https://github.com/orgs/community/discussions/194494

Ngôn ngữ chính
Go
Star
295
Fork
21
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
64

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-actions-lock

Tất cả issue của github/gh-actions-lock

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.