-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkibi-report.yml
More file actions
84 lines (77 loc) · 2.93 KB
/
Copy pathkibi-report.yml
File metadata and controls
84 lines (77 loc) · 2.93 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Canonical Kibi GitHub Pages workflow: badge + full HTML report.
#
# Copy this file to .github/workflows/kibi-report.yml
# Manual step: Settings → Pages → Source → GitHub Actions
#
# Pull requests generate and validate the report, then upload it as a
# workflow artifact. Only the repository default branch (and manual
# workflow_dispatch) may deploy the canonical report to GitHub Pages.
# Use the unprivileged pull_request event so untrusted PR code cannot
# inherit default-branch secrets or Pages write permissions.
#
# Package manager: this example uses npm (`cache: npm` and `npm ci`).
# For pnpm, Yarn, or Bun, change those two values; see
# https://github.com/Looted/kibi/blob/develop/docs/github-integration.md
name: Kibi requirement health
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
# GitHub Actions checkouts are detached. Kibi requires an exact branch
# identity, so this must be set before kibi sync and kibi report.
env:
KIBI_BRANCH: ${{ github.head_ref || github.ref_name }}
concurrency:
group: ${{ github.event_name == 'pull_request' && format('kibi-pr-report-{0}', github.event.number) || 'pages' }}
cancel-in-progress: false
jobs:
build-report:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
- name: Install SWI-Prolog
run: |
sudo apt-get update
sudo apt-get install -y swi-prolog
- run: npm ci
- run: npm exec -- kibi sync
- run: npm exec -- kibi report --output kibi-report
- name: Upload Kibi PR report
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v5
with:
name: kibi-pr-report
path: kibi-report
if-no-files-found: error
- name: Namespace Pages output under /kibi-report/
if: ${{ github.event_name != 'pull_request' }}
run: |
mkdir -p pages/kibi-report
cp -R kibi-report/. pages/kibi-report/
- uses: actions/configure-pages@v6
if: ${{ github.event_name != 'pull_request' }}
- uses: actions/upload-pages-artifact@v5
if: ${{ github.event_name != 'pull_request' }}
with:
path: pages
deploy-report:
needs: build-report
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'workflow_dispatch' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) }}
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy requirement health
id: deployment
uses: actions/deploy-pages@v5