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

オープン
#268 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github, github-actions, go
領域
cli, devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Go
スター
295
フォーク
21
平均マージ
1日 3時間
マージ済み PR(30日)
64

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-actions-lock のほかの issue

github/gh-actions-lock の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。