File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ jobs:
116116 - run : npm run generate-api-docs
117117 - name : Commit generated API docs to same-repo PR
118118 if : github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
119+ env :
120+ # Bind the attacker-controllable PR branch name to an env var so it is
121+ # passed as a literal value, never interpolated into the script text
122+ # (prevents shell injection — OSSF Scorecard Dangerous-Workflow).
123+ HEAD_REF : ${{ github.head_ref }}
119124 run : |
120125 if git diff --quiet -- apps/website/content/docs/*/api/api-docs.json; then
121126 echo "Generated API docs are already committed."
@@ -126,7 +131,7 @@ jobs:
126131 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
127132 git add apps/website/content/docs/*/api/api-docs.json
128133 git commit -m "chore(docs): regenerate api docs"
129- git push origin "HEAD:${{ github.head_ref }} "
134+ git push origin "HEAD:$HEAD_REF "
130135 - name : Verify generated API docs are committed
131136 run : git diff --exit-code -- apps/website/content/docs/*/api/api-docs.json
132137 - run : npx nx build website
You can’t perform that action at this time.
0 commit comments