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

Unhandled errors in workflow dispatch #406

Closed
justinabrahms opened this issue Jul 10, 2023 · 1 comment · Fixed by #409
Closed

Unhandled errors in workflow dispatch #406

justinabrahms opened this issue Jul 10, 2023 · 1 comment · Fixed by #409

Comments

@justinabrahms
Copy link
Contributor

justinabrahms commented Jul 10, 2023

The underlying code says:

    // this entry point doesn't actually return anything sensible

And if you looked at github's docs, you'd believe that to be the case.

Unfortunately lots of stuff could go wrong.

  1. Not auth'd correctly.
  2. invalid ref specified
  3. Unexpected inputs provided
  4. Required inputs not provided

Please return errors as appropriate.

Invalid ref

< HTTP/2 422 
< server: GitHub.com
< date: Mon, 10 Jul 2023 23:10:56 GMT
< content-type: application/json; charset=utf-8
< content-length: 156
< x-oauth-scopes: admin:org, admin:public_key, gist, repo
< x-accepted-oauth-scopes: 
< x-oauth-client-id: REDACTED
< x-github-media-type: github.v3; format=json
< x-github-api-version-selected: 2022-11-28
< x-ratelimit-limit: 5000
< x-ratelimit-remaining: 4995
< x-ratelimit-reset: 1689034140
< x-ratelimit-used: 5
< x-ratelimit-resource: core
< access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubdomains; preload
< x-frame-options: deny
< x-content-type-options: nosniff
< x-xss-protection: 0
< referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
< content-security-policy: default-src 'none'
< vary: Accept-Encoding, Accept, X-Requested-With
< x-github-request-id: REDACTED
< 
{
  "message": "No ref found for: topic-branch",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}

Unexpected inputs

< HTTP/2 422 
< server: GitHub.com
< date: Mon, 10 Jul 2023 23:16:16 GMT
< content-type: application/json; charset=utf-8
< content-length: 164
< x-oauth-scopes: admin:org, admin:public_key, gist, repo
< x-accepted-oauth-scopes: 
< x-oauth-client-id: REDACTED
< x-github-media-type: github.v3; format=json
< x-github-api-version-selected: 2022-11-28
< x-ratelimit-limit: 5000
< x-ratelimit-remaining: 4992
< x-ratelimit-reset: 1689034140
< x-ratelimit-used: 8
< x-ratelimit-resource: core
< access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubdomains; preload
< x-frame-options: deny
< x-content-type-options: nosniff
< x-xss-protection: 0
< referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
< content-security-policy: default-src 'none'
< vary: Accept-Encoding, Accept, X-Requested-With
< x-github-request-id: REDACTED
< 
{
  "message": "Unexpected inputs provided: [\"home\"]",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}

Missing inputs

< HTTP/2 422 
< server: GitHub.com
< date: Mon, 10 Jul 2023 23:16:47 GMT
< content-type: application/json; charset=utf-8
< content-length: 160
< x-oauth-scopes: admin:org, admin:public_key, gist, repo
< x-accepted-oauth-scopes: 
< x-oauth-client-id: REDACTED
< x-github-media-type: github.v3; format=json
< x-github-api-version-selected: 2022-11-28
< x-ratelimit-limit: 5000
< x-ratelimit-remaining: 4991
< x-ratelimit-reset: 1689034140
< x-ratelimit-used: 9
< x-ratelimit-resource: core
< access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubdomains; preload
< x-frame-options: deny
< x-content-type-options: nosniff
< x-xss-protection: 0
< referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
< content-security-policy: default-src 'none'
< vary: Accept-Encoding, Accept, X-Requested-With
< x-github-request-id: REDACTED
< 
{
  "message": "Required input 'name' not provided",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}
@XAMPPRocky
Copy link
Owner

Thank you for your issue! I don't have time to fix this myself, but I would be willing to accept a PR that updates the code to propagate these errors 🙂

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 a pull request may close this issue.

2 participants