A GitHub Action that reads agent configuration metadata from the calling repository. This action parses the .fleetControl/configurationDefinitions.yml file and makes the configuration data available for downstream workflow steps.
Add this action to your workflow:
- name: Read agent metadata
uses: newrelic/agent-metadata-action@v1This action automatically checks out your repository at the specified version tag, then reads the .fleetControl/configurationDefinitions.yml file and other associated files in /fleetControl and saves the agent information in New Relic. The action handles the checkout internally, so you don't need to include a separate actions/checkout step. If you do not want to use this action, you can call New Relic directly to add the agent information.
name: Process Agent Metadata
on:
push:
branches: [main]
jobs:
read-metadata:
runs-on: ubuntu-latest
steps:
- name: Read agent metadata
uses: newrelic/agent-metadata-action@v1
with:
agent-type: dotnet # Required: The type of agent (e.g., dotnet, java, python)
version: 1.0.0 # Required: will be used to check out appropriate release tag
cache: true # Optional: Enable Go build cache (default: true)This action automatically checks out the calling repo's commit, detects the changed release notes and saves the agent metadata in New Relic. The action handles the checkout internally, so you don't need to include a separate actions/checkout step. If you do not want to use this action, you can call New Relic directly to add the agent metadata.
name: Process Agent Metadata
on:
push:
branches: [main]
jobs:
read-metadata:
runs-on: ubuntu-latest
steps:
- name: Read agent metadata
uses: newrelic/agent-metadata-action@v1
with:
cache: true # Optional: Enable Go build cache (default: true)For the agent scenario, the action expects a YAML file at .fleetControl/configurationDefinitions.yml with the following structure:
configurationDefinitions:
- platform: "kubernetes" # or "host"
description: "Description of the configuration"
type: "config-type"
version: "1.0.0"
format: "json"
schema: "./schemas/config-schema.json"All fields are required. The action validates each configuration entry and will fail with a clear error message if any required field is missing (version, platform, description, type, format, schema).
Schema files are automatically base64-encoded and embedded in the output. Schema paths must be relative to the .fleetControl directory and cannot use directory traversal (..) for security.
To build the action locally:
# Build the binary
go build -o agent-metadata-action ./cmd/agent-metadata-action
# Run locally
/bin/bash /Users/mvick/IdeaProjects/agent-metadata-action/run_local.sh Run the test suite:
# Run all tests
go test ./...
# Run tests with verbose output
go test -v ./...
# Run tests for a specific package
go test -v ./internal/config
# Run a specific test
go test -v -run TestLoadEnv_Success ./internal/configNew Relic hosts and moderates an online forum where you can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:
Add the url for the support thread here: discuss.newrelic.com
We encourage your contributions to improve Agent Metadata Action! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.
If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at [email protected].
A note about vulnerabilities
As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through our bug bounty program.
If you would like to contribute to this project, review these guidelines.
To all contributors, we thank you! Without your contribution, this project would not be what it is today.
Agent Metadata Action is licensed under the Apache 2.0 License.
