Skip to content

Allow fetch prerelease #495

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

Closed
wants to merge 5 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/repo/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Provides information about releases for a repository. Wraps [GitHub Releases API
$release = $client->api('repo')->releases()->latest('twbs', 'bootstrap');
```

The ```latest()``` method fetches only releases which are not marked "prerelease."
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should only use one backtick at each side of the word.
`latest()`

Copy link
Collaborator

Choose a reason for hiding this comment

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

"prerelease" and "draft".


To obtain the latest release *including prereleases*, select the first element in the "all releases" function:
Copy link
Collaborator

Choose a reason for hiding this comment

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

*including* prereleases and drafts,

Copy link
Author

Choose a reason for hiding this comment

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

auth is required for drafts. I've added that to the doc also

```
Copy link
Collaborator

Choose a reason for hiding this comment

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

```php

$release = $client->api('repo')->releases()->all('username', 'repo')[0];
```
### List releases for a tag

```php
Expand Down