Skip to content

ref_name-description.md: fix format for PRs#30907

Merged
hubwriter merged 2 commits into
github:mainfrom
aspiers:patch-1
Feb 5, 2024
Merged

ref_name-description.md: fix format for PRs#30907
hubwriter merged 2 commits into
github:mainfrom
aspiers:patch-1

Conversation

@aspiers

@aspiers aspiers commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

Why:

The current docs for github.ref_name do not represent the reality of how it behaves. Instead, they claim that for PRs, the format is refs/pull/<pr_number>/merge. This claim comes from PR #29712 which was submitted to address issue #15319.

However when referring to github.ref and github.ref_name, #15319 states:

Instead these variables are populated by values like refs/pull/26/merge and 26/merge respectively.

I have just tested this and found that the actual format is indeed <pr_number>/merge, not the longer version. (This makes sense, since it's more consistent with github.ref_name being the short form of github.ref in other cases.)

What's being changed (if available, include any code snippets, screenshots, or gifs):

This PR fixes the docs to represent the actual reality that github.ref_name always returns the short format, even for PRs.

Check off the following:

  • I have reviewed my changes in staging, available via the View deployment link in this PR's timeline.

    • For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the data directory.
  • For content changes, I have completed the self-review checklist.

The docs for `github.ref_name` claim that for PRs, the format is `refs/pull/<pr_number>/merge`; however I have just tested this and found that the actual format is `<pr_number>/merge`.  This makes sense, since it's more consistent with `github.ref_name` being the short form of `github.ref` in other cases.

So fix the docs to represent the actual reality that it returns the short format for PRs too.
@welcome

welcome Bot commented Jan 3, 2024

Copy link
Copy Markdown

Thanks for opening this pull request! 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 Jan 3, 2024
@aspiers aspiers mentioned this pull request Jan 3, 2024
2 tasks
@nguyenalex836

Copy link
Copy Markdown
Contributor

@aspiers Thanks so much for opening a PR! I'll get this triaged for review ✨

@nguyenalex836 nguyenalex836 added content This issue or pull request belongs to the Docs Content team 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 Jan 3, 2024

@hubwriter hubwriter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aspiers - Many thanks for checking and correcting this.

Much appreciated. 👍

@hubwriter hubwriter enabled auto-merge February 5, 2024 09:37
@hubwriter hubwriter added this pull request to the merge queue Feb 5, 2024
Merged via the queue into github:main with commit f0449f6 Feb 5, 2024
@github-actions

github-actions Bot commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues

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 waiting for review Issue/PR is waiting for a writer's review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants