@@ -33,24 +33,30 @@ jobs:
3333 repository : ClickHouse/clickhouse-docs
3434 path : ./
3535
36- # Step 2: Setup node
37- - name : Set up Node.js
38- uses : actions/setup-node@v4
36+ - name : Fetch pull request labels
37+ if : github.event_name == 'deployment_status'
38+ id : fetch-labels
39+ uses : actions/github-script@v6
3940 with :
40- node-version : ' 20.18.0'
41- cache : ' yarn'
41+ script : |
42+ const pr = await github.pulls.get({
43+ owner: context.repo.owner,
44+ repo: context.repo.repo,
45+ pull_number: context.payload.deployment_status.deployment.payload.pull_request.number
46+ });
47+ core.setOutput('labels', JSON.stringify(pr.data.labels));
4248
49+ # Step 3: Check for "visual-test" label
50+ - name : Check for "visual-test" label
51+ id : label-check
52+ run : |
53+ echo "Checking for 'visual-test' label..."
54+ echo "${{ steps.fetch-labels.outputs.labels }}" | jq '.[].name' | grep -q 'visual-test' && echo "true" || echo "false"
55+ shell : bash
56+ env :
57+ LABELS : ${{ steps.fetch-labels.outputs.labels }}
58+
4359 - name : Log BASE_URL
4460 run : echo "BASE_URL=${{ github.event.deployment_status.environment_url }}"
4561 env :
46- BASE_URL : ${{ github.event.deployment_status.environment_url }}
47-
48- # Step 3: Run Playwright tests
49- - name : Run Playwright tests
50- run : yarn playwright test
51- env :
52- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53- BASE_URL : ${{ github.event.deployment_status.environment_url }}
54- ARGOS_BRANCH : ${{ github.event.deployment_status.environment == 'Production' && 'main' || github.ref_name }}
55- CI : true
56- ARGOS_TOKEN : ${{ secrets.ARGOS_TOKEN }}
62+ BASE_URL : ${{ github.event.deployment_status.environment_url }}
0 commit comments