InnerSourceCommons / InnerSourceCommons/InnerSourcePatterns

Unexpected failure in GitHub Action run

Aperta
#581 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Type - Maintenance / Cleanup
Lingua principale
HTML
Stelle
853
Fork
206
Merge medio
1g 23h
PR unite (30g)
2

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da .github/workflows/book.yml su main e dalla versione nella pull request #579, quindi esamina l’esecuzione del workflow 6003953262 e il passaggio actions/checkout che usa github.head_ref. Confronta il contesto dell’evento, il repository estratto e i refs disponibili per spiegare il fallimento. Il lavoro è completo quando sono documentati la versione del workflow e il ref utilizzati e viene identificata la configurazione necessaria affinché il workflow del PR venga eseguito correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, github-actions
Ambito
ci-cd, devops
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.