Skip to content

Commit 4132876

Browse files
committed
fix(percy): added security measures per PR feedback
1 parent a427f77 commit 4132876

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/baseline-visual-regression.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ jobs:
3232
# Extract target stories from PR body
3333
- name: Extract target stories
3434
id: extract_stories
35+
env:
36+
PR_BODY: ${{ github.event.pull_request.body }}
3537
run: |
36-
# Get the last merged PR details
37-
PR_BODY=$(gh pr view $(git log -1 --pretty=format:"%s" | grep -oP '#\d+') --json body -q '.body')
38-
if [[ $PR_BODY == *"package: skin"* ]]; then
38+
# Use the PR_BODY environment variable securely
39+
if [[ "$PR_BODY" == *"package: skin"* ]]; then
3940
STORIES=$(echo "$PR_BODY" | awk '/Percy Stories/{getline; print}')
4041
if [ -z "$STORIES" ]; then
4142
echo "No Percy Stories found in PR body."

0 commit comments

Comments
 (0)