LoginSignup
1
0

More than 3 years have passed since last update.

actでUnable to resolve v1: reference not foundが出たときの解決方法

Posted at

act実行時に少し詰まってしまったので備忘録として残しておきます。

現象

pronto-rubocopのGitHub Actionsを、actのDry runで実行したところ、ruby/setup-rubyのv1を見つけられないエラーが発生しました。

> act pull_request -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 -n
・・・略・・・
*DRYRUN* [Checks/unit_tests-43] ⭐  Run ruby/setup-ruby@v1
*DRYRUN* [Checks/unit_tests-43]   ☁  git clone 'https://github.com/ruby/setup-ruby' # ref=v1
*DRYRUN* [Checks/unit_tests-43] Unable to resolve v1: reference not found
*DRYRUN* [Checks/unit_tests-43]   ❌  Failure - ruby/setup-ruby@v1
Error: reference not found

調査

actのissueに類似現象が記載されていました。
Unable to resolve v1: reference not found #311
このissueをたどっていくと、気になるコメントを見つけました。

The issue occurs if v1, v2 refs are branches, not tags. But yes, it's very annoying and needs to be fixed.

v1やv2がタグになく、ブランチにあるとこの問題が発生するようです。
ruby/setup-rubyを確認してみると、ブランチにはv1がありますが、タグにはv1はなくv1.0.0がある状態でした。
ブランチ: https://github.com/ruby/setup-ruby/branches
タグ: https://github.com/ruby/setup-ruby/releases/tag/v1.0.0

なお、この問題はすでにPull Request(Fix "reference not found" error #433)が作成され、マージ済みとなっていました。この変更では、まずタグに該当バージョンがないか探し、なければブランチで該当バージョンを探す処理となっているようです。

リリースバージョンはv0.2.19となっており、私が使っているバージョンを確認すると0.2.16だったので、今回の問題の原因はこのことだったようです。

対応

actはbrewで入れたので、brew upgradeを行いactのバージョンアップを行いました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0