Config

You can provide Honk with a configuration through the use of a POST request to https://gethonk.io/rules/upload.

For this, you will need to follow a series of steps:

  1. Create a token on your honk dashboard. Once created, make a note of it, it will appear at the top of the page only once.
  2. Create a configuration file and upload it.
    • The best approach for this is to host this configuration inside a GitHub repository. You can automate the upload process through the use of a GitHub action. This is where the token comes into play. Add that as a repository secret

Example GitHub action

# .github/workflows/upload_config.yml
on:
   push:
      paths:
         - 'rules.yaml'
         - '.github/workflows/upload_config.yml'

jobs:
   upload_config:
      runs-on: ubuntu-latest
      steps:
         - uses: actions/checkout@v3
         - id: upload_config_staging
           uses: oneroar/upload-config@main
           with:
              token: ${{ secrets.token }}

If you would rather upload the configuration manually, the upload-config job does the following thing

curl --write-out '%{http_code}' \
     --silent --output /dev/null \
     -X POST  -H "X-Honk-Token:$TOKEN" \
     https://gethonk.io/rules/upload/ \
     -F "file_uploaded=@rules.yaml" --fail