Hotpot documentation

GitHub

How to integrate GitHub with Hotpot.

You can create moments or page someone via GitHub Actions.

Example: Sending Hotpot a moment on action failure

GitHub actions are commonly used to automate tasks such as deploys. When such a task fails, it may warrant an investigation and, therefore, a moment!

Your first step will be to get a Hotpot API key and add it as a secret to your GitHub Action. This example uses a secret named HOTPOT_WEBHOOK_URL.

Next, add the moment creation as a step:


  - name: Notify Hotpot on failure
    if: failure()
    env:
        HOTPOT_WEBHOOK_URL: ${{ secrets.HOTPOT_WEBHOOK_URL }}
    run: |
        curl -X POST -H 'Content-type: application/json' -d '{"name": "[Production] failed", "type": "Problem", "tags": ["production"], "source_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", "description": "Unable to deploy ${{ github.event.pull_request.html_url || github.event.head_commit.url }} This needs to be debugged and understood." }' ${{ env.HOTPOT_WEBHOOK_URL }}

Note that you can adjust the tags and contents to suit your needs!

Last updated

© 2024 Oilcan, Inc. All rights reserved.