diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40951b5..27caf9c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: workflow_dispatch: inputs: branch: + description: Used to set which branch of CLI to use for current run required: false type: string default: master @@ -40,16 +41,19 @@ jobs: - run: yarn - name: Set up @percy/cli from git if: ${{ github.event_name == 'workflow_dispatch' }} + env: + BRNACH: ${{ github.event.inputs.branch }} + WORKSPACE: ${{ github.workspace }} run: | cd /tmp - git clone --branch ${{ github.event.inputs.branch }} --depth 1 https://github.com/percy/cli + git clone --branch "$BRANCH" --depth 1 https://github.com/percy/cli cd cli PERCY_PACKAGES=`find packages -mindepth 1 -maxdepth 1 -type d | sed -e 's/packages/@percy/g' | tr '\n' ' '` git log -1 yarn yarn build yarn global:link - cd ${{ github.workspace }} + cd "$WORKSPACE" yarn remove @percy/cli && yarn link `echo $PERCY_PACKAGES` npx percy --version - run: yarn test:coverage