yakshaveinc / tasks

distributed roadmap
The Unlicense
1 stars 0 forks source link

Check GitHub PR status from command line #51

Open abitrolly opened 4 years ago

abitrolly commented 4 years ago

To monitor if tests pass after git push.

$ curl -i https://api.github.com/repos/snapcore/snapcraft/commits/pull/2673/head/statuses

Get ETag and use it for 2 seconds polling (can use watch) to overcome rate limits of 60 requests per hour.

$ curl -i https://api.github.com/repos/snapcore/snapcraft/commits/pull/2673/head/statuses -H 'If-None-Match: "8baab59d6f96268449fcd9b42b348334"'
HTTP/1.1 304 Not Modified
Date: Thu, 24 Oct 2019 05:10:26 GMT
Server: GitHub.com
Status: 304 Not Modified
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1571897232
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: "8baab59d6f96268449fcd9b42b348334"
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Frame-Options: deny
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Content-Security-Policy: default-src 'none'
Vary: Accept-Encoding
X-GitHub-Request-Id: D6A4:C2F2:3466048:4018A36:5DB13241