InnerSourceCommons / InnerSourceCommons/InnerSourcePatterns
Unexpected failure in GitHub Action run
Personne n'a encore pris cette issue.
- Langage dominant
- HTML
- Étoiles
- 853
- Forks
- 206
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 2
Description
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?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par .github/workflows/book.yml sur main et par la version présente dans la pull request #579, puis examinez l’exécution du workflow 6003953262 et l’étape actions/checkout utilisant github.head_ref. Comparez le contexte de l’événement, le dépôt extrait et les refs disponibles afin d’expliquer l’échec. Le travail est terminé lorsque la version du workflow et le ref utilisés sont documentés, et que la configuration nécessaire pour que le workflow du PR s’exécute correctement est identifiée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- git, github-actions
- Domaine
- ci-cd, devops
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100