The gihub.ref description is confusing and incorrect, particularly for PRs
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- github-actions
- Domínio
- documentation
Direção de pesquisa
Comece pelo artigo sobre o contexto do GitHub do GitHub Actions na URL docs.github.com vinculada e, em seguida, compare a descrição de github.ref com a documentação de eventos vinculada. Esclareça o comportamento de cada evento listado e reestruture o parágrafo em casos legíveis; o trabalho estará concluído quando a descrição estiver precisa e inequívoca.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context
What part(s) of the article would you like to see updated?
The description for github.ref is confusing, misleading and incorrect, particularly for PR events.
The fully-formed ref of the branch or tag that triggered the workflow run. For workflows triggered by
push, this is the branch or tag ref that was pushed. For workflows triggered bypull_requestthat were not merged, this is the pull request merge branch. If the pull request was merged, this is the head branch. For workflows triggered byrelease, this is the release tag created. For other triggers, this is the branch or tag ref that triggered the workflow run. This is only set if a branch or tag is available for the event type. The ref given is fully-formed, meaning that for branches the format isrefs/heads/<branch_name>. For pull requests events exceptpull_request_targetthat were not merged, it isrefs/pull/<pr_number>/merge.pull_request_targetevents have thereffrom the base branch. For tags it isrefs/tags/<tag_name>. For example,refs/heads/feature-branch-1.
Firstly, it's quite hard to follow the different branching logic of that parapgrah. Can this be formatted better, e.g. with nested bullet points?
Secondly, particularly for PR events, the logic is quite unclear, and incorrect in some places. The description mentions
pull requests events
but doesn't define them what these are. Is it the following subset of triggers?
Assuming this is the case, my understanding of the logic is as follows:
pull_requestevents with aclosedactivity type that were merged:github.ref=refs/heads/<head_branch>- All other
pull_requestevents:github.ref=refs/pull/<pr_number>/merge - All
pull_request_targetevents (potentially excluding merged events):github.ref=refs/heads/<base_branch> issue_comment,pull_request_reviewandpull_request_review_comment(and potentially mergedpull_request_target) events:github.ref=refs/pull/<pr_number>/merge
Problems to highlight:
- It's unclear whether "pull requests events except
pull_request_targetthat were not merged" includes mergedpull_request_targetevents. My tests suggest it doesn't; mergedpull_request_targetevents showrefs/heads/main, notrefs/pull/<pr_number>/merge. What is this line trying to say? - On a merged
pull_requestevent, my tests show<base_branch>, not<head_branch>. There is a mistake in the description. - For
pull_request_targetevents, regardless of PR direction (main->testortest->main), my tests showrefs/heads/main. Is it always the repo default, not the PR base? - My tests show
issue_commentevents userefs/heads/main(regardless of PR direction), notrefs/pull/<pr_number>/merge. Are these events not part of the PR logic? Does it always use the repo default? - If we're being picky, there's a case to be made that "workflows triggered by
pull_requestthat were not merged" means "closedand not merged" - meaning other activity types might not be included in the list. This could be worded better
Is the following summary more accurate?
- All
pull_request_targetevents:refs/heads/<default_branch> - Merged
pull_requestevents:refs/heads/<base_branch> - All other
pull_requestevents, and allpull_request_reviewandpull_request_review_commentevents:refs/pull/<pr_number>/merge issue_commentevents:refs/heads/<default_branch>
Additional information
No response
- Linguagem predominante
- TypeScript
- Estrelas
- 20.9k
- Forks
- 68.9k
- Merge médio
- 8h 3min
- PRs com merge (30d)
- 116
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/docs
-
content triage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
builder persona content copilot
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
Mantenedores costumam responder em até 1 dia
-
content driver persona never-stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/docs#46116 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
localization never-stale
Dificuldade 2/5 1-2 dias Facilidade para iniciantes 72/100
github/docs#45949 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
content localization never-stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
github/docs#45858 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/docs
Issues semelhantes
-
bug HemiStake
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
hemilabs/ui-monorepo#2413 ·
Mantenedores costumam responder em até 1 dia
-
component/ui framework/react kind/bug language/javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
meshery/meshery#22216 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
company delete fails with 500 on any company that has activity (cost events, inbox dismissals)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
paperclipai/paperclip#14982 ·
Mantenedores costumam responder em até 1 dia
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 95/100
lingdojo/kana-dojo#31515 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia