InnerSourceCommons / InnerSourceCommons/InnerSourcePatterns
Unexpected failure in GitHub Action run
還沒有人認領這個 Issue。
- 主要語言
- 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:
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.ymlfile from this branch/PR (which comes from a fork) - however the file that really got executed is actually the one on the
mainbranch 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
mainbranch, or the ones on the PR branch, or both? mainand 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?
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 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