Skip to content

Commit 0f53998

Browse files
committed
Add validate.yaml
1 parent 27d834b commit 0f53998

2 files changed

Lines changed: 41 additions & 69 deletions

File tree

.github/workflows/labels.yaml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/validate.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PR Validation
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, labeled, unlabeled]
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-full-validation:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check Full Validation Status
13+
uses: actions/github-script@v6
14+
with:
15+
github-token: ${{secrets.GITHUB_TOKEN}}
16+
script: |
17+
const { owner, repo } = context.repo;
18+
const runs = await github.rest.actions.listWorkflowRuns({
19+
owner,
20+
repo,
21+
workflow_id: 'nightly.yaml',
22+
branch: 'main',
23+
status: 'completed'
24+
});
25+
if (runs.data.workflow_runs.length === 0) {
26+
core.setFailed('No successful nightly runs found.');
27+
} else if (runs.data.workflow_runs[0].conclusion !== 'success') {
28+
core.setFailed(`Last nightly run failed. See: ${runs.data.workflow_runs[0].html_url}`);
29+
}
30+
31+
quick-validation:
32+
needs: check-full-validation
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v3
37+
38+
- name: Run Quick Validation
39+
run: |
40+
echo "Running quick validation:"
41+
# Your quick validation steps here

0 commit comments

Comments
 (0)