Skip to content

Commit

Permalink
fix: make Github Action safe to RCE via pull request title (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
lociko authored Feb 5, 2025
1 parent 36d632d commit c6844ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ jobs:
- uses: actions/checkout@v4
- name: Extract version to be released
id: get-version
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
else
TITLE="${{ github.event.pull_request.title }}"
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
echo "version=${PR_TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
fi
- name: Bump version and push tag
uses: mathieudutour/[email protected]
Expand Down

0 comments on commit c6844ba

Please sign in to comment.