forked from flybywiresim/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.36 KB
/
build-validation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Strict Build Validation
on:
pull_request_target:
types: [opened, ready_for_review]
jobs:
validate:
# Prevent running this on forks
if: github.repository_owner == 'flybywiresim'
runs-on: ubuntu-latest
steps:
- name: Get PR SHA
id: sha
uses: actions/github-script@v5
with:
result-encoding: string
script: |
const { owner, repo, number } = context.issue;
const pr = await github.rest.pulls.get({
owner,
repo,
pull_number: number,
});
return pr.data.head.sha
- uses: actions/checkout@v2
with:
ref: ${{ steps.sha.outputs.result }}
fetch-depth: 0
- name: Make Build
uses: actions/setup-python@v2
with:
python-version: 3.x
- run: |
pip install -r requirements.txt
mkdocs build -s
- name: Message failure
if: ${{ failure() }}
uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Strict Build Failed! ❌ - Please checkout this PR locally to fix the issue before merging or see checks.',
});