Skip to content

Commit 2866ff5

Browse files
committed
comment on originating PR with BIT results
1 parent 062505a commit 2866ff5

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
@@ -64,7 +67,7 @@ jobs:
6467
github_token: ${{ secrets.GITHUB_TOKEN }}
6568
workflow: build-browser.yml
6669
workflow_conclusion: ""
67-
branch: ${{ inputs.CLIENTS_BRANCH || 'main' }}
70+
branch: ${{ github.event.client_payload.origin_branch || inputs.CLIENTS_BRANCH || 'main' }}
6871
name: ^dist-chrome-MV3-\w{7}\.zip$
6972
name_is_regexp: true
7073
repo: bitwarden/clients
@@ -129,14 +132,15 @@ jobs:
129132
npm ci
130133
131134
- name: Run all tests
135+
id: playwright-tests
132136
run: npm run test:static:ci
133137

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

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

0 commit comments

Comments
 (0)