Skip to content

Commit c1331ce

Browse files
committed
ci: checks
1 parent 8996cac commit c1331ce

File tree

1 file changed

+1
-59
lines changed

1 file changed

+1
-59
lines changed

.github/workflows/ui-tests.yml

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: UI Tests
22

33
on:
4-
workflow_run:
5-
workflows: ["CI"]
6-
types:
7-
- completed
4+
push:
85
branches: [ "master" ]
96
workflow_dispatch:
107

@@ -13,63 +10,8 @@ jobs:
1310
runs-on: ubuntu-latest
1411
outputs:
1512
should_run: ${{ steps.check-pr-status.outputs.should_run }}
16-
pr_number: ${{ steps.find-pr.outputs.pr_number }}
17-
18-
steps:
19-
- name: Find associated pull request
20-
id: find-pr
21-
uses: actions/github-script@v7
22-
with:
23-
script: |
24-
const commitSha = '${{ github.event.workflow_run.head_sha }}';
25-
const { data: pullRequests } = await github.rest.pulls.list({
26-
owner: context.repo.owner,
27-
repo: context.repo.repo,
28-
state: 'open',
29-
sort: 'updated',
30-
direction: 'desc',
31-
per_page: 100
32-
});
33-
34-
for (const pr of pullRequests) {
35-
if (pr.head.sha === commitSha) {
36-
console.log(`Found matching PR: #${pr.number}`);
37-
core.setOutput('pr_number', pr.number);
38-
return;
39-
}
40-
}
41-
42-
console.log('No matching PR found for this commit');
43-
core.setOutput('pr_number', '');
44-
45-
- name: Check PR draft status
46-
id: check-pr-status
47-
if: steps.find-pr.outputs.pr_number != ''
48-
uses: actions/github-script@v7
49-
with:
50-
script: |
51-
const prNumber = parseInt('${{ steps.find-pr.outputs.pr_number }}');
52-
if (!prNumber) {
53-
console.log('No PR number found, skipping UI tests');
54-
core.setOutput('should_run', 'false');
55-
return;
56-
}
57-
58-
const { data: pr } = await github.rest.pulls.get({
59-
owner: context.repo.owner,
60-
repo: context.repo.repo,
61-
pull_number: prNumber
62-
});
63-
64-
const shouldRun = !pr.draft;
65-
console.log(`PR #${prNumber} draft status: ${pr.draft}`);
66-
console.log(`Should run UI tests: ${shouldRun}`);
67-
68-
core.setOutput('should_run', shouldRun.toString());
6913

7014
ui-tests:
71-
needs: check-conditions
72-
if: ${{ needs.check-conditions.outputs.should_run == 'true' }}
7315
runs-on: ubuntu-latest
7416

7517
steps:

0 commit comments

Comments
 (0)