Skip to content

GitHub Version Tags

GitHub Actions allows you to perform numerous tasks automatically, including using the cURL command to insert a new tag when a release is made or when a pull request is closed for example.

This tutorial demonstrates how to build an automation that will create a new tag in Coralogix upon publishing a new release of your code.

Coralogix Version Tags API Endpoint

This document includes cluster-dependent URLs.

Refer to the following table to select the correct Coralogix Version Tags API endpoint for the domain associated with your Coralogix account.

Domain Region Endpoint
coralogix.us US1 (Ohio) https://webapi.coralogix.us/api/v1/external/tags/
cx498.coralogix.com US2 (Oregon) https://webapi.cx498.coralogix.com/api/v1/external/tags/
coralogix.com EU1 (Ireland) https://webapi.coralogix.com/api/v1/external/tags/
eu2.coralogix.com EU2 (Stockholm) https://webapi.eu2.coralogix.com/api/v1/external/tags/
app.coralogix.in AP1 (Mumbai) https://webapi.app.coralogix.in/api/v1/external/tags/
coralogixsg.com AP2 (Singapore) https://webapi.coralogixsg.com/api/v1/external/tags/
ap3.coralogix.com AP3 (Jakarta) https://webapi.ap3.coralogix.com/api/v1/external/tags/

Tutorial

STEP 1. Create your Action as a .yml file inside our repository in the workflows directory .github/workflows/my-tag-automation.yml.

Note:

  • Remember to place the .github folder inside the root folder of your repository.

STEP 2. Add the content of your action.

  • Add the name of the automation and the events that activate it.
name: "Create a tag"

on:
  release:
    types: [published]
  • Add the 'job' of our automation -- the action that it will execute.
name: "Create a tag"

on:
  release:
    types: [published]

jobs:
  run-updater:
    runs-on: ubuntu-latest
    steps:
    - name: create a tag
      run: |
        curl --location --request POST '<cluster_endpoint>' \
        --header 'Authorization: Bearer <cx_api_key>' \
        --header 'Content-Type: application/json' \
        --data-raw '{ 
        "name": "'"${GITHUB_REF##*/}"'",
        "application": ["<my_app>"],
        "subsystem": ["<my_subsystem>"]
        }'

${GITHUB_REF##*/} = a github action variable holding the reference of the action , in this context its the tag of the release.

<my_app> - Your Application name. You can input more than one name, use the comma delimiter ‘,’ between the names.

<my_subsystem> - Your Subsystem name. You can input more than one name, use the comma delimiter ‘,’ between the names.

<cluster_endpoint> - The endpoint depending on your Coralogix domain.

<cx_api_key> - To use this API you need to create a personal or team API key. It’s recommended to use permission presets, as they are automatically updated with all relevant permissions. Alternatively, you can manually add individual permissions.

Preset Action Description
CICDIntegration VERSION-BENCHMARK-TAGS:READ
VERSION-BENCHMARKS-REPORTS:READ
VERSION-BENCHMARK-TAGS:UPDATE
View Version Benchmark Tags
View Version Benchmark Reports
Modify Version Benchmark Tags

STEP 3. After publishing a new release, the Action will run, and a new tag in Coralogix will be created.

Additional Resources

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].