Skip to content
Draft
Changes from all commits
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
27 changes: 27 additions & 0 deletions .github/workflows/openapi-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,30 @@ jobs:
exit 1
fi
echo "✓ Bundles have valid sizes"

trigger-client-model-regeneration:
name: Trigger Python client model regeneration
runs-on: ubuntu-latest
needs: [validate]
if: github.event_name == 'pull_request'

steps:
- uses: actions/checkout@v6

- name: Check if OpenAPI files changed
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
openapi:
- 'apify-api/openapi/**'

- name: Trigger apify-client-python model regeneration
if: steps.filter.outputs.openapi == 'true'
run: |
gh workflow run regenerate_models.yaml \
--repo apify/apify-client-python \
--field docs_pr_number=${{ github.event.pull_request.number }} \
--field docs_pr_branch=${{ github.head_ref }}
Copy link

Choose a reason for hiding this comment

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

Script injection via unsanitized github.head_ref in shell

High Severity

${{ github.head_ref }} is directly interpolated into a run shell script, creating a script injection vulnerability. An attacker can craft a malicious branch name containing shell metacharacters (e.g., embedding $(curl ...)) that will execute arbitrary commands. This is especially dangerous here because the APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN cross-repo secret is exposed in the environment and could be exfiltrated. The value needs to be passed via an environment variable instead of inline ${{ }} interpolation.

Fix in Cursor Fix in Web

env:
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}