InnerSourceCommons / InnerSourceCommons/InnerSourcePatterns

Unexpected failure in GitHub Action run

未關閉
#581 10 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Type - Maintenance / Cleanup
主要語言
HTML
星號
853
分支
206
平均合併
1 天 23 小時
30 天內合併 PR
2

描述

In a recent pull request (https://github.com/InnerSourceCommons/InnerSourcePatterns/pull/579), one of our GitHub Action (GHA) workflow runs failed.

Overview of failed GHAs:
Screenshot 2023-08-29 at 09 49 14

Now when looking at the details of that workflow run, I noticed something interesting:

  • when you click on "workflow file", it takes you to the book.yml file from this branch/PR (which comes from a fork)
  • however the file that really got executed is actually the one on the main branch of the upstream. I am so sure about this as the main branch contains the config for a matrix build for this GHA, while the branch from the PR does not have that matrix build yet)

So at the very least I am starting to wonder how GHAs really work. Seems like I might have some misunderstandings here.

My questions are:

  • which GHAs are executed? the ones on the main branch, or the ones on the PR branch, or both?
  • main and PR contain different versions of the same GHA. what happens in that case?

And lastly:
Why does this GHA run fail at all?

It seems like it is looking for a git ref hive-mind-pattern-1 and cannot find it? Possibly because that ref only exists on the fork but not on the upstream?

Do we have to configure the actions/checkout differently, so that it can find that git ref?
Right now we use ref: ${{ github.head_ref }}, which is defined as:

The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

I am suspecting that we are checking out the upstream repo InnerSourceCommons/InnerSourcePatterns but then trying to point to a ref that does not exist on that upsream.

Just not sure how one would configure this correctly?

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 main 上的 .github/workflows/book.yml 以及 pull request #579 中的版本開始,然後檢查 workflow run 6003953262 和使用 github.head_ref 的 actions/checkout 步驟。比較事件內容、已檢出的儲存庫和可用的 refs,以解釋失敗原因。完成標準是記錄所使用的 workflow 版本和 ref,並確定使 PR workflow 成功執行所需的設定。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
git, github-actions
領域
ci-cd, devops
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。