Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/perf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
description: 'Git SHA to build (defaults to current HEAD)'
required: false
type: string
cohort_streamed_diff_enabled:
description: 'Set AMPLITUDE_COHORT_STREAMED_DIFF_ENABLED=true on the perf-test deployment'
required: false
default: false
type: boolean

jobs:
trigger-sdk-tests:
Expand All @@ -29,6 +34,15 @@ jobs:
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
fi

- name: Get cohort streamed diff flag
id: get-flag
run: |
if [ "${{ github.event.inputs.cohort_streamed_diff_enabled }}" = "true" ]; then
echo "cohort_streamed_diff_enabled=true" >> $GITHUB_OUTPUT
else
echo "cohort_streamed_diff_enabled=false" >> $GITHUB_OUTPUT
fi

Comment on lines +44 to +50

@semgrep-amplitude semgrep-amplitude Bot Jul 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using variable interpolation ${{...}} with github context data in a run: step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with env: to store the data and use the environment variable in the run: script. Be sure to use double-quotes the environment variable, like this: "$ENVVAR".

🎉 Fixed in commit 86010d6 🎉

- name: Generate GitHub App token
id: generate-token
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2
Expand All @@ -49,7 +63,8 @@ jobs:
"ref": "${{ github.ref }}",
"repo_url": "${{ github.repositoryUrl }}",
"triggered_by": "${{ github.actor }}",
"workflow_run_id": "${{ github.run_id }}"
"workflow_run_id": "${{ github.run_id }}",
"cohort_streamed_diff_enabled": "${{ steps.get-flag.outputs.cohort_streamed_diff_enabled }}"
}
}'

Expand All @@ -60,5 +75,6 @@ jobs:
echo "- **SHA**: ${{ steps.get-sha.outputs.sha }}" >> $GITHUB_STEP_SUMMARY
echo "- **Ref**: ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
echo "- **Triggered by**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "- **Cohort streamed diff enabled**: ${{ steps.get-flag.outputs.cohort_streamed_diff_enabled }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Check the [sdk-tests workflow runs](https://github.com/amplitude/sdk-tests/actions) for build progress." >> $GITHUB_STEP_SUMMARY
Loading