Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading examples for github.ref #35215

Open
1 task done
dimaqq opened this issue Nov 7, 2024 · 7 comments
Open
1 task done

Misleading examples for github.ref #35215

dimaqq opened this issue Nov 7, 2024 · 7 comments
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team SME reviewed An SME has reviewed this issue/PR

Comments

@dimaqq
Copy link

dimaqq commented Nov 7, 2024

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 canonical/operator#1451

@dimaqq dimaqq added the content This issue or pull request belongs to the Docs Content team label Nov 7, 2024
Copy link

welcome bot commented Nov 7, 2024

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.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Nov 7, 2024
@dimaqq
Copy link
Author

dimaqq commented Nov 7, 2024

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

@nguyenalex836 nguyenalex836 added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Nov 7, 2024
@nguyenalex836
Copy link
Contributor

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

@nguyenalex836 nguyenalex836 added the needs SME This proposal needs review from a subject matter expert label Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀

@jc-clark
Copy link
Contributor

jc-clark commented Nov 15, 2024

Hey @dimaqq! Thanks for finding this. We agree that the docs should be updated.

What do you think of updating the ref description reusable with something like this?

for pull requests events except pull_request_target, it is refs/pull/<pr_number>/merge.
pull_request_target events have the ref from the base branch.

This reusable is in the table here and in "Store information in variables"

@dimaqq
Copy link
Author

dimaqq commented Nov 16, 2024

Sounds good :)

@nguyenalex836
Copy link
Contributor

@dimaqq Awesome to hear! Would you be willing to submit a PR for this update? Otherwise, we'll open this issue up to the community 💛

@nguyenalex836 nguyenalex836 added SME reviewed An SME has reviewed this issue/PR and removed waiting for review Issue/PR is waiting for a writer's review needs SME This proposal needs review from a subject matter expert labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team SME reviewed An SME has reviewed this issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants