-
Notifications
You must be signed in to change notification settings - Fork 53
🧪 Update e2e PR workflow to run based on PR description text #2770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,17 +13,45 @@ on: | |
| paths: | ||
| - "cypress/**" | ||
| - ".github/workflows/e2e*.yaml" | ||
| - ".github/actions/**" | ||
|
|
||
| concurrency: | ||
| group: e2e-repo-main-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| extract-test-tags: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| test_tags: ${{ steps.extract.outputs.test_tags }} | ||
| steps: | ||
| - name: Extract test tags from PR body | ||
| id: extract | ||
| env: | ||
| PR_BODY: ${{ github.event.pull_request.body }} | ||
| DEFAULT_TAGS: "@ci,@tier0" | ||
| run: | | ||
| if [[ -n "$PR_BODY" ]]; then | ||
| # Look for pattern "ci test tags: @tag1,@tag2,..." in PR body | ||
| EXTRACTED=$(echo "$PR_BODY" | grep -oP '^ci test tags: \K@.+(,@.+)*$' || true) | ||
| if [[ -n "$EXTRACTED" ]]; then | ||
| echo "Found test tags in PR body: $EXTRACTED" | ||
| echo "test_tags=$EXTRACTED" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "No test tags pattern found in PR body, using default: $DEFAULT_TAGS" | ||
| echo "test_tags=$DEFAULT_TAGS" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| else | ||
| echo "No PR body available (not a pull request or body is empty), using default: $DEFAULT_TAGS" | ||
| echo "test_tags=$DEFAULT_TAGS" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| e2e-tests: | ||
| needs: extract-test-tags | ||
| uses: ./.github/workflows/e2e-run-ui-tests.yaml | ||
| with: | ||
| test_tags: "@ci,@tier0" | ||
| feature_auth_required: false | ||
| test_tags: ${{ needs.extract-test-tags.outputs.test_tags }} | ||
| feature_auth_required: true | ||
| bundle_image: quay.io/konveyor/tackle2-operator-bundle:latest | ||
| install_konveyor_version: ${{ github.base_ref || github.ref_name }} | ||
| install_konveyor_version: main | ||
| test_ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like GitHub Actions expression language does not support || . This line will silently resolve incorrectly. This might help :
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Weird, the test_ref did get resolved correctly for this PR. For a PR, it should resolve to the sha of the HEAD commit. I haven't run the workflow directly against a branch yet. Not sure I can do that while it is still only in a PR. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion :
This regex Match "ci test tags:" anywhere in the body (case-insensitive) and Remove spaces → allow "@ci, @tier0"