Skip to content

Populate user agent header for Github Requests #481

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

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Feb 2, 2023

https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required

All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value. This allows us to contact you if there are problems.

It seems this may be the culprit why we are still seeing a 403.

https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function

Default Github Actions Env. variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required

> All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value. This allows us to contact you if there are problems.

It seems this may be the culprit why we are seeing a 403.

https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function

See: https://ge.micronaut.io/s/l2lhrfn7gzlck

Default Github Actions Env. variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
@sdelamo sdelamo added the bug Something isn't working label Feb 2, 2023
Copy link
Member

@alvarosanchez alvarosanchez left a comment

Choose a reason for hiding this comment

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

Why not setting the user agent unconditionally?

Copy link
Contributor

@melix melix left a comment

Choose a reason for hiding this comment

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

Will have to be merged to 6.2.x and master.

@sdelamo
Copy link
Contributor Author

sdelamo commented Feb 2, 2023

Why not setting the user agent unconditionally?

I thought about it. But it seems more correct to differentiate requests issued from CI.

@sdelamo sdelamo merged commit e205ebe into 5.4.x Feb 2, 2023
@sdelamo sdelamo deleted the populate-user-agent-header branch February 2, 2023 09:53
sdelamo added a commit that referenced this pull request Feb 2, 2023
https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required

> All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value. This allows us to contact you if there are problems.

It seems this may be the culprit why we are seeing a 403.

https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function

See: https://ge.micronaut.io/s/l2lhrfn7gzlck

Default Github Actions Env. variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
sdelamo added a commit that referenced this pull request Feb 2, 2023
https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required

> All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value. This allows us to contact you if there are problems.

It seems this may be the culprit why we are seeing a 403.

https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function

See: https://ge.micronaut.io/s/l2lhrfn7gzlck

Default Github Actions Env. variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
melix pushed a commit that referenced this pull request Feb 3, 2023
https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required

> All API requests MUST include a valid User-Agent header. Requests with no User-Agent header will be rejected. We request that you use your GitHub username, or the name of your application, for the User-Agent header value. This allows us to contact you if there are problems.

It seems this may be the culprit why we are seeing a 403.

https://stackoverflow.com/questions/39907742/github-api-is-responding-with-a-403-when-using-requests-request-function

See: https://ge.micronaut.io/s/l2lhrfn7gzlck

Default Github Actions Env. variables: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants