This GitHub Action lets you create annotations in Axiom. For more information, see the Axiom documentation.
You can configure GitHub Actions using YAML syntax. For more information, see the GitHub documentation.
- Create an Axiom account.
- Create a dataset.
- Create an advanced API token in Axiom with permissions to update dashboards.
- Send data to your Axiom dataset.
To create an annotation when a deployment happens in GitHub, follow these steps:
-
Add the following to the end of your GitHub Action file:
- name: Add annotation in Axiom when a deployment happens uses: axiomhq/annotation-action@v0.1.0 with: axiomToken: ${{ secrets.API_TOKEN }} datasets: DATASET_NAME type: 'production-release' time: '2024-01-01T00:00:00Z' # optional, defaults to now endTime: '2024-01-01T01:00:00Z' # optional, defaults to null title: 'Production deployment' # optional description: 'Commit ${{ github.event.head_commit.message }}' # optional url: 'https://example.com' # optional, defaults to job url
-
In the code above, replace the following:
- Replace
DATASET_NAME
with the Axiom dataset where you want to send data. To add the annotation to more than one dataset, enter a string of Axiom dataset names separated by commas. For exampledatasets: 'DATASET_NAME_1, DATASET_NAME_2, DATASET_NAME_3'
. - Add the Axiom API token to your GitHub secrets, and replace
API_TOKEN
with the name of this secret.
- Replace
-
Customize the other fields of the code above such as the title, the description, and the URL.
This creates an annotation in Axiom each time you deploy in GitHub.
This action has the ID of the annotation as an output, read the ci.yaml to see how to use it.