Skip to content

Workflow Dispatch Command Injection Fix #24864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions .github/workflows/push-tag-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
run: echo "TAG_NAME=${GITHUB_REF}" >> $GITHUB_ENV
- name: Set tag name from manual input
if: github.event_name == 'workflow_dispatch'
run: echo "TAG_NAME=refs/tags/${{ github.event.inputs.tag }}" >> $GITHUB_ENV
env:
TAG: ${{ github.event.inputs.tag }}
run: echo "TAG_NAME=refs/tags/$TAG" >> $GITHUB_ENV

- name: Get release metadata JSON
run: |
Expand Down Expand Up @@ -93,9 +95,11 @@ jobs:
persist-credentials: false
- name: Check out tag from manual input
if: github.event_name == 'workflow_dispatch'
env:
TAG: ${{ github.event.inputs.tag }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
with:
ref: refs/tags/${{ github.event.inputs.tag }}
ref: refs/tags/$TAG
fetch-depth: 0 # all history
persist-credentials: false

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ jobs:

### These steps run on workflow_dispatch event only ###
- name: "workflow_dispatch: Load PR number"
env:
PR: ${{ github.event.inputs.pr }}
id: workflow_dispatch_load_pr
if: github.event_name == 'workflow_dispatch'
run: echo "pr_num=${{ github.event.inputs.pr }}" >> $GITHUB_OUTPUT
run: echo "pr_num=$PR" >> $GITHUB_OUTPUT

- name: "workflow_dispatch: Load is_release_branch"
id: workflow_dispatch_is_release_branch
Expand Down