fix: Simplify the logic for get cypress filter step (#15310)

This commit is contained in:
Akash Jain 2024-02-22 15:28:08 +05:30 committed by GitHub
parent e5a1965a5a
commit e620809154
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,8 +83,11 @@ jobs:
- name: Get Cypress Filter
id: get_cypress_filter
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "filter=$(gh pr view --json labels --jq '[.labels[].name | select(startswith(\\"e2e:\\")) | sub(\\"e2e:\\";"")] | join(\\" \\")') >> $GITHUB_OUTPUT
gh pr view --json labels --jq '[.labels[].name | select(startswith("e2e:")) | sub("e2e:";"")] | join(" ")' >> labels
echo "e2eFilters=$(cat labels)" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
@ -144,7 +147,7 @@ jobs:
wait-on: "http://localhost:8585"
group: cypress-ci-mysql-pr-oss-${{ github.run_id }}-${{github.run_attempt}}
browser: chrome
command: cypress run --config-file=cypress.config.ts --env grepTags='${{ steps.get_cypress_filter.outputs.FILTER }}'
command: cypress run --config-file=cypress.config.ts --env grepTags='${{ steps.get_cypress_filter.outputs.e2eFilters }}'
env:
CYPRESS_BASE_URL: "http://localhost:8585"
CYPRESS_RECORD_KEY: ${{ steps.cypress-project-id.outputs.CYPRESS_RECORD_KEY }}