Skip to content

Commit 3d26ad0

Browse files
authored
Merge branch 'gh-actions-test-branch' into fix-v2-versioning
2 parents ffae288 + a769606 commit 3d26ad0

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed

.github/actions/cache-build/action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ runs:
2020
key-2: ${{ hashFiles('apps/**/**.[jt]s', 'apps/**/**.[jt]sx', 'packages/**/**.[jt]s', 'packages/**/**.[jt]sx', '!**/node_modules') }}
2121
key-3: ${{ github.event.pull_request.number || github.ref }}
2222
key-4: ${{ github.sha }}
23+
key-5: ${{ github.event.pull_request.head.sha }}
2324
with:
2425
path: |
2526
${{ github.workspace }}/apps/web/.next
2627
${{ github.workspace }}/apps/web/public/embed
2728
**/.turbo/**
2829
**/dist/**
29-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }}
30+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }}-${{ env.key-5 }}
3031
- run: |
3132
export NODE_OPTIONS="--max_old_space_size=8192"
3233
yarn build

.github/workflows/pr-labeled.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PR Labeled with ready-for-e2e
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
branches:
7+
- main
8+
- gh-actions-test-branch
9+
workflow_dispatch:
10+
jobs:
11+
run-e2e-jobs:
12+
name: Run E2E Jobs
13+
runs-on: buildjet-2vcpu-ubuntu-2204
14+
permissions:
15+
pull-requests: read
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: ./.github/actions/dangerous-git-checkout
19+
20+
- name: Check Label and Retrigger Checks
21+
uses: actions/github-script@v7
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
script: |
25+
const labelName = context.payload.label.name;
26+
const prNumber = context.payload.pull_request.number;
27+
const owner = context.repo.owner;
28+
const repo = context.repo.repo;
29+
30+
if (labelName === 'ready-for-e2e') {
31+
console.log(`Running E2E jobs for PR #${prNumber}...`);
32+
33+
const checkRuns = await github.rest.checks.listForRef({
34+
owner,
35+
repo,
36+
ref: context.payload.pull_request.head.sha,
37+
});
38+
39+
for (const check of checkRuns.data.check_runs) {
40+
console.log('check.name', check.name);
41+
if (check.name.includes('e2e')) {
42+
await github.rest.actions.reRunJob({
43+
owner,
44+
repo,
45+
job_id: check.id,
46+
});
47+
console.log(`Triggering job #${check.id}`);
48+
}
49+
}
50+
51+
console.log(`Triggered E2E checks for PR #${prNumber}`);
52+
} else {
53+
console.log(`Label ${labelName} does not trigger re-running checks.`);
54+
}

.github/workflows/pr.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: PR Update
22

33
on:
44
pull_request_target:
5-
types: [opened, synchronize, reopened, labeled]
65
branches:
76
- main
87
- gh-actions-test-branch
@@ -135,28 +134,28 @@ jobs:
135134
secrets: inherit
136135

137136
e2e:
138-
name: Tests
137+
name: e2e
139138
needs: [changes, check-label, build]
140139
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
141140
uses: ./.github/workflows/e2e.yml
142141
secrets: inherit
143142

144143
e2e-app-store:
145-
name: Tests
144+
name: e2e-app-store
146145
needs: [changes, check-label, build]
147146
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
148147
uses: ./.github/workflows/e2e-app-store.yml
149148
secrets: inherit
150149

151150
e2e-embed:
152-
name: Tests
151+
name: e2e-embed
153152
needs: [changes, check-label, build]
154153
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
155154
uses: ./.github/workflows/e2e-embed.yml
156155
secrets: inherit
157156

158157
e2e-embed-react:
159-
name: Tests
158+
name: e2e-embed-react
160159
needs: [changes, check-label, build]
161160
if: ${{ needs.check-label.outputs.run-e2e == 'true' && needs.changes.outputs.has-files-requiring-all-checks == 'true' }}
162161
uses: ./.github/workflows/e2e-embed-react.yml

0 commit comments

Comments
 (0)