Conversation
This workflow triggers Datadog Synthetic tests on push and pull request events to the main branch.
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: |
There was a problem hiding this comment.
🔴 Security
Issue: The workflow lacks explicit permissions. GitHub Actions workflows should follow the principle of least privilege to prevent potential misuse of the GITHUB_TOKEN.
Fix: Define read-only permissions for contents.
Impact: Reduces the attack surface if the token is compromised.
| jobs: | |
| permissions: | |
| contents: read | |
| jobs: |
| build: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
🟡 Resource Management
Issue: The build job lacks a timeout-minutes configuration. If the Datadog action hangs, it could consume up to 6 hours of runner time.
Fix: Add a reasonable timeout (e.g., 15 minutes).
Impact: Prevents excessive resource consumption and unexpected costs.
| build: | |
| runs-on: ubuntu-latest | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 |
| # Run Synthetic tests within your GitHub workflow. | ||
| # For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci | ||
| - name: Run Datadog Synthetic tests | ||
| uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 |
There was a problem hiding this comment.
🟠 Dependency
Issue: The action is pinned to v1.4.0 (commit 87b5053), which is significantly outdated (2021). This version may lack recent features, security fixes, and performance improvements.
Fix: Update to the latest version v3.2.0 (commit 5604b4d).
Impact: Ensures reliability, security, and access to modern Datadog features.
| uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 | |
| uses: DataDog/synthetics-ci-github-action@5604b4d8929009589d34b2c0388e9d443224a877 # v3.2.0 |
|
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow to run Datadog Synthetic tests as part of CI.
Changes:
- Introduces
.github/workflows/datadog-synthetics.ymlto run Datadog Synthetics viaDataDog/synthetics-ci-github-action. - Configures triggers for
pushandpull_requesttomain, usingDD_API_KEY/DD_APP_KEYsecrets and atest_search_querytag filter.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: actions/checkout@v4 | ||
|
|
||
| # Run Synthetic tests within your GitHub workflow. | ||
| # For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci | ||
| - name: Run Datadog Synthetic tests | ||
| uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 | ||
| with: | ||
| api_key: ${{secrets.DD_API_KEY}} | ||
| app_key: ${{secrets.DD_APP_KEY}} | ||
| test_search_query: 'tag:e2e-tests' #Modify this tag to suit your tagging strategy |
There was a problem hiding this comment.
steps: is not followed by an indented sequence. As written, - uses: actions/checkout@v4 is at the same indentation level as steps:, which makes the workflow YAML invalid (and the job won’t run). Indent the step list items under steps: (and keep the following - name: step aligned with it).
| - uses: actions/checkout@v4 | |
| # Run Synthetic tests within your GitHub workflow. | |
| # For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci | |
| - name: Run Datadog Synthetic tests | |
| uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 | |
| with: | |
| api_key: ${{secrets.DD_API_KEY}} | |
| app_key: ${{secrets.DD_APP_KEY}} | |
| test_search_query: 'tag:e2e-tests' #Modify this tag to suit your tagging strategy | |
| - uses: actions/checkout@v4 | |
| # Run Synthetic tests within your GitHub workflow. | |
| # For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci | |
| - name: Run Datadog Synthetic tests | |
| uses: DataDog/synthetics-ci-github-action@87b505388a22005bb8013481e3f73a367b9a53eb # v1.4.0 | |
| with: | |
| api_key: ${{secrets.DD_API_KEY}} | |
| app_key: ${{secrets.DD_APP_KEY}} | |
| test_search_query: 'tag:e2e-tests' #Modify this tag to suit your tagging strategy |
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] |
There was a problem hiding this comment.
This workflow runs on pull_request, but the Datadog action requires DD_API_KEY/DD_APP_KEY secrets; on PRs from forks, GitHub won’t provide these secrets and the workflow will fail. Consider removing the pull_request trigger or gating the job to only run when secrets are available (e.g., non-fork PRs).
| # 1. Add your Datadog API (DD_API_KEY) and Application Key (DD_APP_KEY) as secrets to your GitHub repository. For more information, see: https://docs.datadoghq.com/account_management/api-app-keys/. | ||
| # 2. Start using the action within your workflow | ||
|
|
||
| name: Run Datadog Synthetic tests |
There was a problem hiding this comment.
The PR description/title don’t indicate that this change introduces a new Datadog Synthetics GitHub Actions workflow. Please update the PR description to explain the intent (which tests are expected to run, when, and any required repo secrets/tags) so reviewers/operators understand the impact.
Description
Type of Change
How Has This Been Tested?
Screenshots (if applicable)
Checklist
Related Issues