github / docs

The open-source repo for docs.github.com
https://docs.github.com
Creative Commons Attribution 4.0 International
16.31k stars 59.8k forks source link

Misleading examples for `github.ref` #35215

Open dimaqq opened 15 hours ago

dimaqq commented 15 hours ago

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context

What part(s) of the article would you like to see updated?

The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>, for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>. For example, refs/heads/feature-branch-1.

Additional information

Surely github.ref is not refs/pull/<pr_number>/merge for an outstanding pull request.

My colleague tripped over reading this bit in https://github.com/canonical/operator/pull/1451

welcome[bot] commented 15 hours ago

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

dimaqq commented 15 hours ago

Clarification:" The difference is between on: pull_request and on: pull_request_target.

nguyenalex836 commented 2 hours ago

Thank you for raising this issue! I'll get this triaged for review :sparkles: Our team will provide feedback regarding the best next steps for this issue - thanks for your patience! 💛