Skip to content

Commit 745c198

Browse files
sluFicodesSHENGXING LU
andauthored
prevent injection code (#196)
Co-authored-by: SHENGXING LU <slu@SHENGXINGs-MacBook-Air.local>
1 parent 08b029c commit 745c198

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/system-testing.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ jobs:
1212
steps:
1313
- name: Check if system testing is activated
1414
id: check_activation
15+
env:
16+
PR_BODY: ${{ github.event.pull_request.body }}
1517
run: |
16-
ACTIVATE=$(echo '${{ github.event.pull_request.body }}' | grep '^SYSTEM_TESTING:' | sed 's/SYSTEM_TESTING: *//' | tr -d '[:space:]')
18+
ACTIVATE=$(echo "$PR_BODY" | grep '^SYSTEM_TESTING:' | sed 's/SYSTEM_TESTING: *//' | tr -d '[:space:]')
1719
echo "System testing activation: '$ACTIVATE'"
1820
if [[ "$ACTIVATE" == "ACTIVATE" ]]; then
1921
echo "activated=true" >> $GITHUB_OUTPUT
@@ -25,19 +27,21 @@ jobs:
2527
2628
- name: Trigger Repository Dispatch
2729
if: steps.check_activation.outputs.activated == 'true'
30+
env:
31+
PR_BODY: ${{ github.event.pull_request.body }}
2832
run: |
2933
echo "Parsing PR body for dependencies..."
3034
3135
# Parse PROXY dependency
32-
PROXY_LOCATION=$(echo '${{ github.event.pull_request.body }}' | grep '^PROXY:' | sed 's/PROXY: *//' | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | xargs)
36+
PROXY_LOCATION=$(echo "$PR_BODY" | grep '^PROXY:' | sed 's/PROXY: *//' | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | xargs)
3337
echo "Proxy location: $PROXY_LOCATION"
3438
3539
# Parse CHARGING dependency
36-
CHARGING_LOCATION=$(echo '${{ github.event.pull_request.body }}' | grep '^CHARGING:' | sed 's/CHARGING: *//' | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | xargs)
40+
CHARGING_LOCATION=$(echo "$PR_BODY" | grep '^CHARGING:' | sed 's/CHARGING: *//' | tr -d '\r' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | xargs)
3741
echo "Charging location: $CHARGING_LOCATION"
3842
3943
# Parse TM_VERSION
40-
TM_VERSION=$(echo '${{ github.event.pull_request.body }}' | grep '^TM_VERSION:' | sed 's/TM_VERSION: *//' | xargs)
44+
TM_VERSION=$(echo "$PR_BODY" | grep '^TM_VERSION:' | sed 's/TM_VERSION: *//' | xargs)
4145
echo "TMForum API version: $TM_VERSION"
4246
4347
# Default values (using upstream FIWARE-TMForum repos)

0 commit comments

Comments
 (0)