Skip to content

Commit 06832aa

Browse files
updated the env variable
1 parent ecb8071 commit 06832aa

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ jobs:
3333
- name: Install dependencies
3434
run: npm install
3535
- name: Run tests
36-
run: npm test
36+
#run: npm test
37+
run: |
38+
BUILD_ID=$(npx percy storybook:start | grep https:\/\/percy.io\/.*\/builds | awk -F "/" '{print $NF}')
39+
# Check if an ID was found and set the environment variable
40+
if [ -n "$BUILD_ID" ]; then
41+
echo "Successfully extracted Percy Build ID: $BUILD_ID"
42+
# Set the environment variable PERCY_BUILD_ID for subsequent steps
43+
echo "PERCY_BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
44+
else
45+
echo "Error: Could not extract Percy Build ID from Percy command output."
46+
fi
3747
env:
3848
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
3949
- name: List files in current directory
@@ -45,3 +55,4 @@ jobs:
4555
run: ./waitForBuildT0End.sh
4656
env:
4757
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
58+
PERCY_BUILD_ID: ${{ env.PERCY_BUILD_ID }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# Dependencies
44
/node_modules
55
.env
6+
.DS_Store

0 commit comments

Comments
 (0)