Skip to content

Commit 8a85754

Browse files
committed
comment on originating PR with BIT results
1 parent e09fb5d commit 8a85754

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

.github/workflows/test-all.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Test-all
2-
run-name: All tests with extension build ${{ inputs.CLIENTS_BRANCH }} by @${{ github.actor }}
2+
run-name: All tests with extension build ${{ inputs.CLIENTS_BRANCH || github.event.client_payload.origin_branch }} by @${{ github.actor }}
33
on:
44
push:
55
branches:
66
- "main"
7+
repository_dispatch:
8+
types: [trigger-bit-tests]
79
pull_request:
810
workflow_dispatch:
911
inputs:
@@ -24,6 +26,7 @@ jobs:
2426
id-token: write
2527
contents: read
2628
packages: read
29+
pull-requests: write
2730
steps:
2831
- name: Checkout
2932
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -65,7 +68,7 @@ jobs:
6568
github_token: ${{ secrets.GITHUB_TOKEN }}
6669
workflow: build-browser.yml
6770
workflow_conclusion: ""
68-
branch: ${{ inputs.CLIENTS_BRANCH || 'main' }}
71+
branch: ${{ github.event.client_payload.origin_branch || inputs.CLIENTS_BRANCH || 'main' }}
6972
name: ^dist-chrome-MV3-\w{7}\.zip$
7073
name_is_regexp: true
7174
repo: bitwarden/clients
@@ -130,14 +133,15 @@ jobs:
130133
npm ci
131134
132135
- name: Run all tests
136+
id: playwright-tests
133137
run: npm run test:static:ci
134138

135139
- name: Update job summary
136140
if: always()
137141
run: echo "$(<./test-summary/test-summary.md)" >> $GITHUB_STEP_SUMMARY
138142

139143
- name: Upload results as artifact
140-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
141145
if: always()
142146
with:
143147
name: test-summary
@@ -146,3 +150,49 @@ jobs:
146150
./test-summary
147151
./tests-out/videos
148152
./tests-out/screenshots
153+
154+
- name: Communicate BIT success on originating issue
155+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
156+
if: failure() && github.event.client_payload.origin_issue
157+
with:
158+
github-token: ${{ secrets.CROSS_REPO_TOKEN }}
159+
script: |
160+
const owner = 'bitwarden';
161+
const message = `⚠️ **Files have been modified in this PR that impact the Autofill experience** ⚠️
162+
163+
[BIT](https://github.com/${owner}/browser-interactions-testing) was run to verify no regressions have been introduced to the core Autofill experience.
164+
165+
❌ Unfortunately, one or more of the BIT tests failed. 😞
166+
167+
Please resolve the failure before merging; reach out to `@bitwarden/team-autofill-dev` if you need help.
168+
169+
You can view the detailed results of the tests [here](https://github.com/${owner}/browser-interactions-testing/actions/runs/${context.runId}).`;
170+
171+
github.rest.issues.createComment({
172+
issue_number: context.payload.client_payload.origin_issue,
173+
owner: owner,
174+
repo: 'clients',
175+
body: message
176+
});
177+
178+
- name: Communicate BIT failure on originating issue
179+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
180+
if: success() && github.event.client_payload.origin_issue
181+
with:
182+
github-token: ${{ secrets.CROSS_REPO_TOKEN }}
183+
script: |
184+
const owner = 'bitwarden';
185+
const message = `⚠️ **Files have been modified in this PR that impact the Autofill experience** ⚠️
186+
187+
[BIT](https://github.com/${owner}/browser-interactions-testing) was run to verify no regressions have been introduced to the core Autofill experience.
188+
189+
✅ Fortunately, the BIT tests have passed! 🎉
190+
191+
You can view the detailed results of the tests [here](https://github.com/${owner}/browser-interactions-testing/actions/runs/${context.runId}).`;
192+
193+
github.rest.issues.createComment({
194+
issue_number: context.payload.client_payload.origin_issue,
195+
owner: owner,
196+
repo: 'clients',
197+
body: message
198+
});

0 commit comments

Comments
 (0)