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

Add API to rerequest a check run #1141

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

Spea
Copy link
Contributor

@Spea Spea commented Aug 17, 2024

This change adds a new method to rerequest a check run (see also https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#rerequest-a-check-run).

*/
public function rerequest(string $username, string $repository, int $checkRunId)
{
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this accept header required for this api endpoint? I don't seem to find it in the api docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, it is the wrong header. I replaced it with the correct one that is listed here

*/
public function rerequest(string $username, string $repository, int $checkRunId)
{
$this->acceptHeaderValue = 'application/vnd.github+json ';
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Spea this is the default header so it doesn't need to be set here. The client will apply that one by default. So if you can remove this line, the PR is good to go!

$builder->addPlugin(new Plugin\HeaderDefaultsPlugin([
'User-Agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)',
'Accept' => sprintf('application/vnd.github.%s+json', $this->apiVersion),
]));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing that out. I removed it now.

@acrobat acrobat merged commit 055cf51 into KnpLabs:master Sep 26, 2024
11 checks passed
@acrobat
Copy link
Collaborator

acrobat commented Sep 26, 2024

Thanks @Spea! And congrats on your first contribution! 🎉

@Spea Spea deleted the rerequest-api branch September 26, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants