peckjon/github-to-guru

[Feature request] Pass jobId as variable

andrewetchen opened this issue · 2 comments

Hi Jon,

First and foremost, thank you so much for taking the time to build this action, I wish I had found this sooner!
I have unintentionally become quite knowledgeable with the GetGuru web app having used it quite extensively the last 2 years.

Context

Our current setup is to send your actions' workflow status to our teams’ Slack channel using a Slack Webhook. However, sending the status of your action will often result in a “success” status even if syntax errors exist within .yaml files for example.

Feature Request

Pass the “jobId” as an env variable which can then be used in a sequential job after your action:

Reference to cURL within the index.js:

github-to-guru/index.js

Lines 22 to 23 in 98392ff

await exec.exec(`curl -u ${auth.username}:${auth.password} https://api.getguru.com/app/contentsyncupload?collectionId=${collectionId} -F "file=@${sourceDir}/guru_collection.zip" -D -`);
}

image

Being able to message our Slack channel with the status results from the following POST would be ideal:

run: |
  curl -u $GURU_USER_EMAIL:$GURU_USER_TOKEN https://api.getguru.com/api/v1/import/{{ jobId }}/status

... if "migrationError' is present/detected, send "fail" status and include the error message value:

image

Thanks in advance and I appreciate your time.

Thanks for the feature request @andrewetchen !

Resolved in release 1.6.0

Note that I've provided the full API response in $GURU_SYNC_RESPONSE in case the definition gets extended, so just post-process that var's contents as JSON

Thank you so much for actioning that so quickly! Much appreciated, @peckjon