Skip to content

Commit 1228042

Browse files
authored
fix(ci): fix script injection from Github context (FTI-7084) (#14791)
FTI-7084
1 parent 147e140 commit 1228042

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/add-release-pongo.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
set_vars:
1010
name: Set Vars
1111
runs-on: ubuntu-latest-kong
12+
env:
13+
REF_NAME: ${{ github.ref_name }}
14+
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
1215
outputs:
1316
code_base: ${{ steps.define_vars.outputs.CODE_BASE }}
1417
tag_version: ${{ steps.define_vars.outputs.TAG_VERSION }}
@@ -25,9 +28,9 @@ jobs:
2528
echo "CODE_BASE=$CODE_BASE" >> "$GITHUB_OUTPUT"
2629
2730
if [[ "${{ github.event_name }}" == "push" ]] ; then
28-
TAG_VERSION="${{ github.ref_name }}"
31+
TAG_VERSION="$REF_NAME"
2932
elif [[ "${{ github.event_name }}" == "release" ]] ; then
30-
TAG_VERSION="${{ github.event.release.tag_name }}"
33+
TAG_VERSION="$RELEASE_TAG_NAME"
3134
fi
3235
echo "TAG_VERSION=$TAG_VERSION" >> "$GITHUB_OUTPUT"
3336
add_release_to_pongo:

.github/workflows/perf.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ jobs:
135135
136136
- name: Choose perf suites
137137
id: choose_perf
138+
env:
139+
COMMENT_BODY: ${{ github.event.comment.body }}
138140
run: |
139-
suites="$(printf '%s' "${{ github.event.comment.body }}" | awk '{print $1}')"
140-
tags="$(printf '%s' "${{ github.event.comment.body }}" | awk '{print $2}')"
141+
suites="$(printf '%s' "$COMMENT_BODY" | awk '{print $1}')"
142+
tags="$(printf '%s' "$COMMENT_BODY" | awk '{print $2}')"
141143
142144
if [[ $suite == "/flamegraph" ]]; then
143145
suites="02-flamegraph"
@@ -166,15 +168,18 @@ jobs:
166168

167169
- name: Find compared versions
168170
id: compare_versions
171+
env:
172+
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
173+
COMMENT_BODY: ${{ github.event.comment.body }}
169174
run: |
170-
pr_ref=$(echo "${{ github.event.pull_request.base.ref }}")
171-
custom_vers="$(printf '%s' "${{ github.event.comment.body }}" | awk '{print $3}')"
175+
pr_ref=$(echo "$PR_BASE_REF")
176+
custom_vers="$(printf '%s' "$COMMENT_BODY" | awk '{print $3}')"
172177
173178
if [[ ! -z "${pr_ref}" ]]; then
174179
vers="git:${{ github.head_ref }},git:${pr_ref}"
175180
elif [[ ! -z "${custom_vers}" ]]; then
176181
vers="${custom_vers}"
177-
elif [[ ! -z "${{ github.event.comment.body }}" ]]; then
182+
elif [[ ! -z "$COMMENT_BODY" ]]; then
178183
vers="git:${{ steps.comment-branch.outputs.head_ref}},git:${{ steps.comment-branch.outputs.base_ref}}"
179184
else # is cron job/on master
180185
vers="git:master,git:origin/master~10,git:origin/master~50"

0 commit comments

Comments
 (0)