Skip to content

CI/CD Integration

ActionXM CLI can be used in CI/CD pipelines by providing a token via environment variable.

Authentication in CI

In CI environments, you cannot use the interactive device auth flow. Instead, generate a token locally and set it as a CI secret.

1. Generate a token

bash
actionxm auth login
actionxm config path
# ~/.config/actionxm/config.json — copy the access_token value

2. Set the CI secret

Add ACTIONXM_TOKEN and ACTIONXM_API_URL as secrets in your CI provider.

3. Configure in your pipeline

yaml
# GitHub Actions example
- name: Install ActionXM CLI
  run: npm install -g actionxm

- name: Configure ActionXM
  run: |
    mkdir -p ~/.config/actionxm
    echo '{"api_url":"${{ secrets.ACTIONXM_API_URL }}","access_token":"${{ secrets.ACTIONXM_TOKEN }}"}' > ~/.config/actionxm/config.json
    chmod 600 ~/.config/actionxm/config.json

- name: Check status
  run: actionxm auth status

Token refresh

CLI tokens are valid for 7 days. Set up a scheduled job to refresh:

bash
# Refresh token (re-run device auth locally and update CI secret)
actionxm auth login

TIP

Consider creating a dedicated CI user in your ActionXM tenant for pipeline access.

ActionXM Analytics Platform