Skip to content

Argus QA

Argus QA #8

Workflow file for this run

name: Argus QA
on:
workflow_run:
workflows: ["CLI Staging Integration"]
types: [completed]
jobs:
trigger-argus:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Trigger Argus QA
run: |
FIRE_AT=$(date -u -d '+30 seconds' '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || \
date -u -v+30S '+%Y-%m-%dT%H:%M:%SZ')
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST https://api.cueapi.ai/v1/cues \
-H "Authorization: Bearer ${{ secrets.ARGUS_API_KEY }}" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"argus-cueapi-cli-${{ github.event.workflow_run.head_sha }}\",
\"schedule\": {\"type\": \"once\", \"at\": \"${FIRE_AT}\"},
\"transport\": \"worker\",
\"payload\": {
\"task\": \"cli-qa\",
\"repo\": \"cueapi-cli\",
\"commit\": \"${{ github.event.workflow_run.head_sha }}\",
\"staging_url\": \"${{ secrets.CUEAPI_STAGING_URL }}\"
}
}")
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -1)
echo "Response ($HTTP_CODE): $BODY"
if [ "$HTTP_CODE" != "201" ]; then
echo "Failed to create Argus cue"
exit 1
fi
echo "Argus will pick up CLI QA cue within 15 seconds."