Automating Deployment Tracking from GitHub actions - not working

dougw

Posted on
Sep 15 2021

I've created a GitHub action to send deployment info to Raygun (based on git tags), and it's not working. The response I get is Error: {"code":400,"message":""} which isn't very helpful!

If I send identical data from my local machine using the API, it works perfectly.

The code for my GitHub action is here: https://gist.github.com/dougwaldron/0c2c9abcefb86b0426efc8583598bd8f


Jasen

Raygun

Posted on
Sep 16 2021

Hi dougw,

The deployments endpoint returns a custom status text with the response indicating the issue with the request. It appears that http-request-action does not include the status text in the error message it outputs. If you are able to check the status text of the response it should tell you the issue with the request. Judging by the response code it is likely that version is not being set correctly.

Kind regards,

Jasen


dougw

Posted on
Sep 16 2021

I'll look into getting the status text of the response. In the meantime, here's the body of the request as sent:

Run fjogeleit/http-request-action@master
with:
  url: https://app.raygun.com/deployments?authToken=***
  method: POST
  data: {
  "apiKey": "***",
  "version": "2021.9.15",
  "ownerName": "redacted",
  "emailAddress": "redacted@users.noreply.github.com",
  "scmIdentifier": "0361e0redacted",
}

The version number is correct and works when sent locally (using a PowerShell script).


dougw

Posted on
Sep 16 2021

It's always the extraneous comma, isn't it?!

I wasn't able to get the 400 response message, but I removed the trailing comma in the JSON and that fixed it.

Updated code: https://gist.github.com/dougwaldron/0c2c9abcefb86b0426efc8583598bd8f


John-Daniel Trask

Raygun

Posted on
Sep 16 2021

It's always the extraneous comma, isn't it?!

Or DNS ;-)

Thanks for sharing the solution Doug!

John-Daniel Trask


Reply