Skip to content

feat: add agent metadata action - step 2#3450

Merged
tannalynn merged 1 commit intodevfrom
mvick/add-agent-metadata-action-step2
Feb 10, 2026
Merged

feat: add agent metadata action - step 2#3450
tannalynn merged 1 commit intodevfrom
mvick/add-agent-metadata-action-step2

Conversation

@mvicknr
Copy link
Collaborator

@mvicknr mvicknr commented Feb 10, 2026

Overview

This PR completes the ability for the NR agent team to send agent metadata to New Relic for use in fleets and other features. This will be triggered normally during a release, but if it fails, it will not fail the release. It can also be run on-demand for backfilling older agent versions, to make corrections, or to re-run the job after a failure.

GH action info: https://github.com/newrelic/agent-metadata-action/blob/main/README.md

Submitter Checklist:

  • Include a link to the related GitHub issue, if applicable
  • Add new tests for your change, if applicable

Testing

This work has been tested manually in: #3448

Reviewer Checklist

  • Perform code review
  • Confirm all checks passed
  • Open a separate PR to add a CHANGELOG entry

@mvicknr mvicknr requested a review from a team as a code owner February 10, 2026 18:13
@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Feb 10, 2026
Comment on lines +65 to +72
needs: [release]
uses: ./.github/workflows/AgentMetadata.yml
with:
version: ${{ github.event.release.tag_name }}
secrets:
FC_SYS_ID_CLIENT_ID: ${{ secrets.FC_SYS_ID_CLIENT_ID }}
FC_SYS_ID_PR_KEY: ${{ secrets.FC_SYS_ID_PR_KEY }}
APM_CONTROL_NR_LICENSE_KEY_STAGING: ${{ secrets.APM_CONTROL_NR_LICENSE_KEY_STAGING }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 9 days ago

In general, the problem is fixed by explicitly adding a permissions: block to the job (or at the workflow root) so that the GITHUB_TOKEN has only the minimal privileges required. Each job that lacks permissions: should be given explicit, least‑privilege settings instead of relying on repository defaults.

For this specific case, we should add a permissions: block under the update-agent-metadata job. Since this job only invokes a reusable workflow and we have no evidence it needs write access in this file, we can safely set the token to read‑only at the job level. A minimal, generic read‑only configuration often used is contents: read. If the reusable workflow actually requires additional write scopes, they should be added there; but we cannot see that file, so we keep changes here minimal and non‑breaking by granting only read access from this workflow. Concretely, in .github/workflows/release.yml, under the update-agent-metadata: job definition (currently starting at line 64), insert:

    permissions:
      contents: read

using the correct indentation (aligned with needs: and uses:). No imports or additional methods are needed; this is purely a YAML configuration change.

Suggested changeset 1
.github/workflows/release.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -63,6 +63,8 @@
 
   update-agent-metadata:
     needs: [release]
+    permissions:
+      contents: read
     uses: ./.github/workflows/AgentMetadata.yml
     with:
       version: ${{ github.event.release.tag_name }}
EOF
@@ -63,6 +63,8 @@

update-agent-metadata:
needs: [release]
permissions:
contents: read
uses: ./.github/workflows/AgentMetadata.yml
with:
version: ${{ github.event.release.tag_name }}
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the permissions are in the AgentMetadata.yml file

@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.33% 93%

@tannalynn tannalynn merged commit 8143953 into dev Feb 10, 2026
45 checks passed
@mvicknr mvicknr deleted the mvick/add-agent-metadata-action-step2 branch February 10, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community To tag external issues and PRs submitted by the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments