Reusable low-level Ontrack GraphQL client for GitHub Actions.
npm login --scope=@nemerosa --registry=https://npm.pkg.github.com
npm install @nemerosa/ontrack-github-action-client
const client = require('@nemerosa/ontrack-github-action-client');
// logging: true or false or undefined
const clientEnvironment = client.checkEnvironment(logging);
// Performing the call
const result = client.graphQL(clientEnvironment, query, variables, logging);
The following environment variables must be available:
ONTRACK_URL
- the root URL of the Ontrack installationONTRACK_TOKEN
- the Ontrack authentication token
Typically, these will be defined at repository or organization level and exposed to the GitHub Actions workflow:
env:
ONTRACK_URL: "${{ vars.ONTRACK_URL }}"
ONTRACK_TOKEN: "${{ secrets.ONTRACK_TOKEN }}"