Add guide: Track GitHub Reusable Workflows with Custom Tags#35615
Draft
Add guide: Track GitHub Reusable Workflows with Custom Tags#35615
Conversation
Add a new guide explaining how to use custom tags to track reusable workflow metadata (version/ref, source repo, caller repo, and inputs) in CI Visibility using the datadog-ci CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Preview links (active after the
|
juliomalegria-dd
approved these changes
Mar 30, 2026
Contributor
|
Created DOCS-13876 for the editorial review. |
Use GitHub Actions REST API to resolve reusable workflow refs automatically instead of relying on github.workflow_ref (which returns the caller's ref). Add secrets declaration, caller examples, and a screenshot showing the tags in CI Visibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
joepeeples
approved these changes
Apr 8, 2026
Contributor
joepeeples
left a comment
There was a problem hiding this comment.
Approved with a few non-blocking formatting suggestions, thanks!
|
|
||
| ## Add reusable workflow tags from the caller workflow | ||
|
|
||
| If you cannot modify the shared workflow, you can tag the metadata from a separate job in the **caller** workflow instead. Use the same [GitHub Actions REST API][8] approach to look up the reusable workflow ref automatically: |
Contributor
There was a problem hiding this comment.
Suggested change
| If you cannot modify the shared workflow, you can tag the metadata from a separate job in the **caller** workflow instead. Use the same [GitHub Actions REST API][8] approach to look up the reusable workflow ref automatically: | |
| If you cannot modify the shared workflow, you can tag the metadata from a separate job in the _caller_ workflow instead. Use the same [GitHub Actions REST API][8] approach to look up the reusable workflow ref automatically: |
| [6]: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context | ||
| [7]: https://docs.github.com/en/actions/sharing-automations/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow | ||
| [8]: https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run | ||
| [9]: /continuous_integration/explorer/ |
Contributor
There was a problem hiding this comment.
This URL reference isn't being used in the page above, so we can omit it:
Suggested change
| [9]: /continuous_integration/explorer/ |
| {{< nextlink href="/account_management/billing/ci_visibility/" >}}CI Visibility Billing Considerations{{< /nextlink >}} | ||
| {{< nextlink href="/continuous_integration/guides/identify_highest_impact_jobs_with_critical_path/" >}}Identify CI Jobs on the Critical Path to Reduce the Pipeline Duration{{< /nextlink >}} | ||
| {{< nextlink href="/continuous_integration/guides/use_ci_jobs_failure_analysis/" >}} Use CI jobs failure analysis to identify root causes in failed jobs{{< /nextlink >}} | ||
| {{< nextlink href="/continuous_integration/guides/track_reusable_workflows/" >}} Track GitHub Reusable Workflow Usage with Custom Tags{{< /nextlink >}} |
Contributor
There was a problem hiding this comment.
Suggested change
| {{< nextlink href="/continuous_integration/guides/track_reusable_workflows/" >}} Track GitHub Reusable Workflow Usage with Custom Tags{{< /nextlink >}} | |
| {{< nextlink href="/continuous_integration/guides/track_reusable_workflows/" >}}Track GitHub Reusable Workflow Usage with Custom Tags{{< /nextlink >}} |
joepeeples
reviewed
Apr 13, 2026
Comment on lines
+33
to
+35
| The most reliable way to tag reusable workflow metadata is to add a tagging step **inside the reusable workflow itself**. This way, every caller automatically gets the tags without extra configuration. | ||
|
|
||
| GitHub does not include reusable workflow metadata (such as the called workflow's ref or path) in the webhook events that Datadog receives, and the [`github.workflow_ref`][6] context variable resolves to the **caller** workflow's ref, not the called workflow's. To work around this, query the [GitHub Actions REST API][8] from within the workflow to look up the `referenced_workflows` for the current run: |
Contributor
There was a problem hiding this comment.
Italics are more common for general emphasis like this:
Suggested change
| The most reliable way to tag reusable workflow metadata is to add a tagging step **inside the reusable workflow itself**. This way, every caller automatically gets the tags without extra configuration. | |
| GitHub does not include reusable workflow metadata (such as the called workflow's ref or path) in the webhook events that Datadog receives, and the [`github.workflow_ref`][6] context variable resolves to the **caller** workflow's ref, not the called workflow's. To work around this, query the [GitHub Actions REST API][8] from within the workflow to look up the `referenced_workflows` for the current run: | |
| The most reliable way to tag reusable workflow metadata is to add a tagging step _inside the reusable workflow itself_. This way, every caller automatically gets the tags without extra configuration. | |
| GitHub does not include reusable workflow metadata (such as the called workflow's ref or path) in the webhook events that Datadog receives, and the [`github.workflow_ref`][6] context variable resolves to the _caller_ workflow's ref, not the called workflow's. To work around this, query the [GitHub Actions REST API][8] from within the workflow to look up the `referenced_workflows` for the current run: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context
CI Visibility does not natively extract reusable workflow metadata (version, ref, source repository). This guide shows users how to bridge the gap using
datadog-ci tag.Test plan
🤖 Generated with Claude Code