Skip to content

fix(build): check out the current commit when this repository tests itself - #136

Open
harada hiroki (hender14) wants to merge 1 commit into
mainfrom
build-self-test-current-sha
Open

fix(build): check out the current commit when this repository tests itself#136
harada hiroki (hender14) wants to merge 1 commit into
mainfrom
build-self-test-current-sha

Conversation

@hender14

Copy link
Copy Markdown

What

build.yml の自己取得の ref を、workflows-c2a 自身からの呼び出しのときだけ実行中のコミットにします。外部から呼ばれた場合は SELF_VERSION のままで、挙動は変わりません。

ref: ${{ github.repository == 'arkedge/workflows-c2a' && github.sha || env.SELF_VERSION }}

Why

  1. リリースのたびに CI が赤くなるSELF_VERSION を次の版に更新した時点ではまだタグが無いため、test-build.yml の自己取得が refs/tags/vX.Y.Z を解決できず失敗します (bump version to v6.0.3 #135 で発生中)
  2. PR が自身のアクション変更を検証できていない — テスト対象の workflow は PR のものですが、実行されるアクションは SELF_VERSION (= 最新タグ) のものになるため、action-c2a-build{,-win32} への変更は CI を通っていません

この 2 つはどちらも「自分自身をテストするときに固定タグを見ている」ことが原因なので、そこだけ実行中のコミットに切り替えます。

補足

同様の条件分岐は amd/skills の再利用ワークフローでも使われています (if: github.repository != 'amd/skills')。

この PR の test-build が緑になれば、PR 自身のコミットのアクションでビルドが通ることの確認になります。

…tself

The self-checkout ref was always SELF_VERSION, so (1) bumping SELF_VERSION turns
CI red until the matching tag exists, and (2) test-build.yml never exercises a
PR's own changes to action-c2a-build{,-win32}. Use github.sha when the caller is
this repository and keep SELF_VERSION for every other caller.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ref: ${{ env.SELF_VERSION }}
ref: ${{ github.repository == 'arkedge/workflows-c2a' && github.sha || env.SELF_VERSION }}

- uses: ./action-c2a-build-win32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [actionlint] reported by reviewdog 🐶
could not parse action metadata in "/github/workspace/action-c2a-build-win32": line 7: unexpected key "type" for definition of input "cmake_flags" [action]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [actionlint] reported by reviewdog 🐶
could not parse action metadata in "/github/workspace/action-c2a-build": line 7: unexpected key "type" for definition of input "reviewdog_filter_mode" [action]

uses: ./action-c2a-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant