Skip to content

Commit ffd2fcd

Browse files
committed
fix: prevent script injection by using env vars instead of github.event
1 parent a574b6f commit ffd2fcd

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/post_release_version_bump.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626

2727
- name: Extract Major.Minor Version and setup Env variable
2828
run: |
29-
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
30-
echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
29+
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_ENV
30+
echo "MAJOR_MINOR=$(echo ${{ env.VERSION }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
3131
3232
- name: Get current major.minor version from main branch
3333
id: get_version
@@ -69,8 +69,8 @@ jobs:
6969
7070
- name: Extract Major.Minor Version and setup Env variable
7171
run: |
72-
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
73-
echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
72+
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_ENV
73+
echo "MAJOR_MINOR=$(echo ${{ env.VERSION }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
7474
7575
- name: Determine release branch and checkout
7676
run: |

.github/workflows/pre_release_prepare.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535
3636
- name: Extract Major.Minor Version and setup Env variable
3737
run: |
38-
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
39-
echo "MAJOR_MINOR=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
38+
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_ENV
39+
echo "MAJOR_MINOR=$(echo ${{ env.VERSION }} | sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+/\1/')" >> $GITHUB_ENV
4040
4141
- name: Create branches
4242
run: |

0 commit comments

Comments
 (0)