Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
7a1c25f
Create cmake-single-platform.yml
lukaszj321 Sep 25, 2025
679f80b
Add initial HTML structure for documentation
lukaszj321 Oct 3, 2025
8f95c54
Initialize mkdocs configuration for documentation
lukaszj321 Oct 3, 2025
35c4692
Add initial documentation for OTCv8 Dev
lukaszj321 Oct 3, 2025
faef881
Add GitHub Actions workflow for documentation deployment
lukaszj321 Oct 3, 2025
9f6bbcd
Update docs.yml
lukaszj321 Oct 3, 2025
bfe28c8
Update mkdocs configuration with additional settings
lukaszj321 Oct 3, 2025
48987c3
Enhance OTCv8 documentation structure and content
lukaszj321 Oct 3, 2025
f320040
Add architecture documentation in architecture.md
lukaszj321 Oct 3, 2025
bc15f90
Add Windows build instructions to documentation
lukaszj321 Oct 3, 2025
e2715fc
Add Linux build instructions to documentation
lukaszj321 Oct 3, 2025
46ba4d5
Add Android build documentation
lukaszj321 Oct 3, 2025
0eb6c23
Add Lua API documentation with examples
lukaszj321 Oct 3, 2025
0d27c71
Add overview documentation for C++
lukaszj321 Oct 3, 2025
2edea43
Add additional MkDocs plugins to installation
lukaszj321 Oct 3, 2025
c0e621d
Add example event in Lua API documentation
lukaszj321 Oct 3, 2025
9b19a12
Initialize mermaid with startOnLoad option
lukaszj321 Oct 3, 2025
99e19ef
Update mkdocs.yml
lukaszj321 Oct 3, 2025
78850d7
Update docs.yml
lukaszj321 Oct 3, 2025
7f687b6
Create script to generate and save embeddings
lukaszj321 Oct 3, 2025
82dcbf2
Add GitHub Actions workflow for RAG build
lukaszj321 Oct 3, 2025
76b7dc3
Update build-embeddings.mjs
lukaszj321 Oct 3, 2025
9d3f075
Rename workflow and update dependencies
lukaszj321 Oct 3, 2025
bbf2017
Update rag.yml
lukaszj321 Oct 3, 2025
f9ed12c
Refine comments in build-embeddings.mjs
lukaszj321 Oct 3, 2025
6538d5c
Update embeddings (no-API)
actions-user Oct 3, 2025
057c0b6
Update rag.yml
lukaszj321 Oct 3, 2025
5265833
Update build-embeddings.mjs
lukaszj321 Oct 3, 2025
f249a89
Update index.md
lukaszj321 Oct 3, 2025
32e8eb8
Update embeddings (no-API)
actions-user Oct 3, 2025
7283a98
Update embedding generation output path
lukaszj321 Oct 3, 2025
fd18e33
Change path for embeddings.json in workflow
lukaszj321 Oct 3, 2025
ca21fda
Update index.md
lukaszj321 Oct 3, 2025
4ab7ec5
Update embeddings (no-API)
actions-user Oct 3, 2025
592480e
Refactor embedding generation and output structure
lukaszj321 Oct 3, 2025
7373829
Enhance rag.yml with new environment settings
lukaszj321 Oct 3, 2025
c920441
Update index.md
lukaszj321 Oct 3, 2025
b0435a3
Update embeddings (no-API)
actions-user Oct 3, 2025
cacb5f8
Create search.html
lukaszj321 Oct 3, 2025
eaf200d
Enhance search.html with improved UI and functionality
lukaszj321 Oct 3, 2025
c8490ce
Update build-embeddings.mjs
lukaszj321 Oct 3, 2025
648eb5f
Update search.html
lukaszj321 Oct 3, 2025
d43ed32
Update embeddings (no-API)
actions-user Oct 3, 2025
54a0592
Update mkdocs.yml
lukaszj321 Oct 3, 2025
d32047e
Update build-embeddings.mjs
lukaszj321 Oct 3, 2025
f963e75
Remove title boosting from scoring calculation
lukaszj321 Oct 3, 2025
c8d2c06
Update mkdocs.yml
lukaszj321 Oct 3, 2025
8339a38
Fix formatting in documentation index
lukaszj321 Oct 3, 2025
8af525a
Update embeddings (no-API)
actions-user Oct 3, 2025
d611d17
Create modules.md
lukaszj321 Oct 3, 2025
3aab009
Add WebSocket guide with examples and principles
lukaszj321 Oct 3, 2025
764823a
Create OTUI documentation with examples and tips
lukaszj321 Oct 3, 2025
68a1244
Update embeddings (no-API)
actions-user Oct 3, 2025
332b26e
Revise Lua style guide and remove example code
lukaszj321 Oct 3, 2025
53e1b50
Update embeddings (no-API)
actions-user Oct 3, 2025
baa6901
Create contributing.md with contribution guidelines
lukaszj321 Oct 3, 2025
f581aaa
Add testing documentation in testing.md
lukaszj321 Oct 3, 2025
d8d98a0
Create release.md
lukaszj321 Oct 3, 2025
7b32f8b
Create security.md with security guidelines
lukaszj321 Oct 3, 2025
b811b83
Add troubleshooting guide for build and Android issues
lukaszj321 Oct 3, 2025
4c27c6b
Create faq.md
lukaszj321 Oct 3, 2025
61955c3
Add glossary entries for OTUI, vBot, and RAG
lukaszj321 Oct 3, 2025
f3e39de
Add initial roadmap with planned features
lukaszj321 Oct 3, 2025
dcfbda6
Add tools documentation in Polish
lukaszj321 Oct 3, 2025
c2a6278
Update search.html
lukaszj321 Oct 3, 2025
c38b866
Update api.md
lukaszj321 Oct 3, 2025
7d04493
Update build-embeddings.mjs
lukaszj321 Oct 3, 2025
53c2622
Update embeddings (no-API)
actions-user Oct 3, 2025
4ce0c44
Delete .github/workflows/cmake-single-platform.yml
lukaszj321 Oct 3, 2025
9594e12
Create seed-docs.yml
lukaszj321 Oct 3, 2025
cff3234
Create exports.yml
lukaszj321 Oct 3, 2025
01f67ac
Create concat-md.mjs
lukaszj321 Oct 3, 2025
07b839d
Update exports.yml
lukaszj321 Oct 3, 2025
e66d626
Update exports.yml
lukaszj321 Oct 3, 2025
2230491
Refactor concat-md.mjs for improved readability
lukaszj321 Oct 3, 2025
01bb057
Update index.md
lukaszj321 Oct 3, 2025
0367cf0
Update embeddings (no-API)
actions-user Oct 3, 2025
9867219
Refactor GitHub Actions workflow for exports
lukaszj321 Oct 3, 2025
2d56a91
Refactor export workflow to use Docker for formats
lukaszj321 Oct 3, 2025
44cd089
Create index.html
lukaszj321 Oct 3, 2025
39ad5f8
Refactor concat-md.mjs for better usability
lukaszj321 Oct 3, 2025
577ec34
Update exports.yml
lukaszj321 Oct 3, 2025
139cd74
Refactor export workflow for document generation
lukaszj321 Oct 3, 2025
49a52ff
Refactor mkdocs path checks and file reading
lukaszj321 Oct 3, 2025
3256e03
Rename seed-docs.yml.disabled to seed-docs.yml
lukaszj321 Oct 3, 2025
4a8fcbc
Update exports.yml
lukaszj321 Oct 3, 2025
7056825
Update exports.yml
lukaszj321 Oct 3, 2025
80ba3e3
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
f4fd4db
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
beb2c4e
Create fix-md.yml
lukaszj321 Oct 3, 2025
a25141d
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
e6dd5f0
Create fix-md.mjs
lukaszj321 Oct 3, 2025
2f68736
Create .markdownlint.json
lukaszj321 Oct 3, 2025
77fa025
Create .prettierrc
lukaszj321 Oct 3, 2025
895f8e0
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
b75fccb
Enhance markdown auto-fix script with exclusions
lukaszj321 Oct 3, 2025
d8d71c3
Update fix-md.yml
lukaszj321 Oct 3, 2025
9a0ebd5
Update export workflow to include PDF format
lukaszj321 Oct 3, 2025
fec5775
chore(md): auto-fix formatting
actions-user Oct 3, 2025
631cd76
Update .gitignore
lukaszj321 Oct 3, 2025
40800a0
chore(md): auto-fix formatting
actions-user Oct 3, 2025
e2047d6
Enhance exports workflow with PDF and DOCX generation
lukaszj321 Oct 3, 2025
d2bda7d
chore(md): auto-fix formatting
actions-user Oct 3, 2025
452a606
Improve argument validation in concat-md.mjs
lukaszj321 Oct 3, 2025
7e1afe8
Update fix-md.mjs
lukaszj321 Oct 3, 2025
21144d6
chore(md): auto-fix formatting
actions-user Oct 3, 2025
042ba7f
Update mkdocs.yml
lukaszj321 Oct 3, 2025
2eebd53
export: PDF/DOCX/EPUB/ZIP
actions-user Oct 3, 2025
ac07f2c
Update exports.yml
lukaszj321 Oct 3, 2025
83bb9c6
Update fix-md.yml
lukaszj321 Oct 3, 2025
0a437d2
Update fix-md.mjs
lukaszj321 Oct 3, 2025
a5382f4
Update mkdocs.yml
lukaszj321 Oct 3, 2025
f9a6c8a
chore(md): auto-fix formatting
actions-user Oct 3, 2025
4cb5a03
Update mkdocs.yml
lukaszj321 Oct 3, 2025
365795a
chore(md): auto-fix formatting
actions-user Oct 3, 2025
02749ac
Update exports.yml
lukaszj321 Oct 3, 2025
c6f4fc6
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
291a9a5
Update index.md
lukaszj321 Oct 3, 2025
47967d8
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
c9032bd
Create otcv8-full-api.md
lukaszj321 Oct 3, 2025
2d72167
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
10523e9
Update mkdocs.yml
lukaszj321 Oct 3, 2025
55f69fe
chore(md): auto-fix formatting
actions-user Oct 3, 2025
eb66723
Update mkdocs.yml
lukaszj321 Oct 3, 2025
41a6650
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
af9f292
Create normalize-md.mjs
lukaszj321 Oct 3, 2025
0aabeaf
Refactor GitHub Actions workflow for documentation export
lukaszj321 Oct 3, 2025
10fb626
chore(md): auto-fix formatting
actions-user Oct 3, 2025
7ed7375
Create extract-api.mjs
lukaszj321 Oct 3, 2025
7d92353
chore(md): auto-fix formatting
actions-user Oct 3, 2025
e572a0d
Add export workflow for documentation formats
lukaszj321 Oct 3, 2025
d5cbe91
Update exports.yml
lukaszj321 Oct 3, 2025
993ee77
chore(md): auto-fix formatting
actions-user Oct 3, 2025
ae0b813
Update mkdocs.yml
lukaszj321 Oct 3, 2025
e048b5d
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
9834829
Rename workflow to 'Fix Markdown (manual)'
lukaszj321 Oct 3, 2025
06fed25
Update exports.yml
lukaszj321 Oct 3, 2025
db125af
export: DOCX/EPUB/ZIP
actions-user Oct 3, 2025
a596216
Update exports.yml
lukaszj321 Oct 3, 2025
b0ddbe9
Update extract-api.mjs
lukaszj321 Oct 3, 2025
c1bdfbe
Update normalize-md.mjs
lukaszj321 Oct 3, 2025
ce29b34
Add GitHub Actions workflow for API exports
lukaszj321 Oct 3, 2025
e07f351
Fix formatting of RAG demo entry in mkdocs.yml
lukaszj321 Oct 3, 2025
db16295
Update api-export.yml
lukaszj321 Oct 3, 2025
2147b18
Fix formatting of RAG demo entry in mkdocs.yml
lukaszj321 Oct 3, 2025
3c82fda
Modify commit message to include [skip ci]
lukaszj321 Oct 3, 2025
36360c1
Update extract-api.mjs
lukaszj321 Oct 3, 2025
864a77d
Update normalize-md.mjs
lukaszj321 Oct 3, 2025
c9279f4
Create pages.yml
lukaszj321 Oct 3, 2025
0e972a4
Update api-export.yml
lukaszj321 Oct 3, 2025
feff69a
workflowyoff
lukaszj321 Oct 3, 2025
2cc3938
workflowback
lukaszj321 Oct 3, 2025
d73e0b9
Create *.yml
lukaszj321 Oct 3, 2025
eb9e9c5
Add workflow for bulk cleanup of GitHub actions
lukaszj321 Oct 3, 2025
4d57942
Update cleanup.yml
lukaszj321 Oct 3, 2025
03992c5
Rename pages.yml to pages_off.yml
lukaszj321 Oct 3, 2025
04aa07d
Create pages-cleanup.yml
lukaszj321 Oct 3, 2025
0e41e1d
Update pages-cleanup.yml
lukaszj321 Oct 3, 2025
075b030
Update cleanup.yml
lukaszj321 Oct 3, 2025
812eea9
Update cleanup.yml
lukaszj321 Oct 3, 2025
7aea61b
Update cleanup.yml
lukaszj321 Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .github/workflows/*.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
on:
workflow_dispatch: {} # usuń `push:` i `pull_request:`
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
48 changes: 48 additions & 0 deletions .github/workflows/api-export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: API + Exports
on:
workflow_dispatch: {} # tylko ręcznie

permissions:
contents: write

concurrency:
group: api-exports-manual
cancel-in-progress: false # nie zabijaj w trakcie

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }

- uses: actions/setup-node@v4
with: { node-version: "20" }

- run: npm i glob js-yaml --no-save
- run: node scripts/extract-api.mjs
- run: node scripts/concat-md.mjs mkdocs.yml OTCv8-Docs.md
- run: node scripts/normalize-md.mjs OTCv8-Docs.md

- uses: actions/setup-python@v5
with: { python-version: "3.x" }
- run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material mkdocs-macros-plugin mkdocs-git-revision-date-localized-plugin
- run: mkdocs build

- run: |
sudo apt-get update && sudo apt-get install -y pandoc zip
mkdir -p docs/downloads
pandoc OTCv8-Docs.md -f gfm+hard_line_breaks-raw_html -t docx -o docs/downloads/OTCv8-Docs.docx --wrap=none
pandoc OTCv8-Docs.md -f gfm+hard_line_breaks-raw_html -t epub -o docs/downloads/OTCv8-Docs.epub --toc --wrap=none
zip -r docs/downloads/site.zip site
ls -lh docs/downloads

- name: Commit artefaktów (bez odpalania innych CI)
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add -f docs/api/otcv8-full-api.md docs/downloads/*
git commit -m "[skip ci] docs: auto API + exports" || echo "no changes"
git push
126 changes: 126 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Bulk cleanup (manual)

on:
workflow_dispatch:
inputs:
delete_artifacts:
type: boolean
default: true
description: Delete all artifacts too

permissions:
actions: write
contents: read
pages: write

concurrency:
group: repo-cleanup
cancel-in-progress: false

env:
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.repository.split('/')[1] }}

jobs:
cancel_and_delete:
runs-on: ubuntu-latest
steps:
- name: Cancel queued & in_progress runs
uses: actions/github-script@v7
with:
script: |
const owner = process.env.OWNER, repo = process.env.REPO;
async function cancelAll(status){
for await (const resp of github.paginate.iterator(
github.rest.actions.listWorkflowRunsForRepo,
{ owner, repo, status, per_page: 100 }
)) {
const runs = resp.data?.workflow_runs || [];
for (const run of runs) {
try {
core.info(`Cancel ${status} ${run.id} — ${run.name}`);
await github.rest.actions.cancelWorkflowRun({ owner, repo, run_id: run.id });
await new Promise(r => setTimeout(r, 120));
} catch (e) {
core.warning(`Cancel failed ${run.id}: ${e.message}`);
}
}
}
}
await cancelAll('queued');
await cancelAll('in_progress');

- name: Delete completed runs
uses: actions/github-script@v7
with:
script: |
const owner = process.env.OWNER, repo = process.env.REPO;
let n = 0;
for await (const resp of github.paginate.iterator(
github.rest.actions.listWorkflowRunsForRepo,
{ owner, repo, status: 'completed', per_page: 100 }
)) {
const runs = resp.data?.workflow_runs || [];
for (const run of runs) {
try {
core.info(`Delete ${run.id} — ${run.name}`);
await github.rest.actions.deleteWorkflowRun({ owner, repo, run_id: run.id });
n++; await new Promise(r => setTimeout(r, 80));
} catch (e) {
core.warning(`Delete failed ${run.id}: ${e.message}`);
}
}
}
core.notice(`Deleted ${n} completed runs`);

- name: Delete artifacts (optional)
if: ${{ inputs.delete_artifacts }}
uses: actions/github-script@v7
with:
script: |
const owner = process.env.OWNER, repo = process.env.REPO;
let n = 0;
for await (const resp of github.paginate.iterator(
github.rest.actions.listArtifactsForRepo,
{ owner, repo, per_page: 100 }
)) {
const arts = resp.data?.artifacts || [];
for (const a of arts) {
try {
core.info(`Delete artifact ${a.id} — ${a.name}`);
await github.rest.actions.deleteArtifact({ owner, repo, artifact_id: a.id });
n++; await new Promise(r => setTimeout(r, 60));
} catch (e) {
core.warning(`Artifact delete failed ${a.id}: ${e.message}`);
}
}
}
core.notice(`Deleted ${n} artifacts`);

- name: Cancel GitHub Pages deployments (best-effort)
uses: actions/github-script@v7
with:
script: |
const owner = process.env.OWNER, repo = process.env.REPO;
try {
for await (const resp of github.paginate.iterator(
github.request, 'GET /repos/{owner}/{repo}/pages/deployments',
{ owner, repo, per_page: 100 }
)) {
const list = Array.isArray(resp.data) ? resp.data : (resp.data?.deployments || []);
for (const d of list) {
try {
core.info(`Cancel Pages deployment ${d.id} (${d.status})`);
await github.request(
'POST /repos/{owner}/{repo}/pages/deployments/{deployment_id}/cancel',
{ owner, repo, deployment_id: d.id }
);
await new Promise(r => setTimeout(r, 150));
} catch (e) {
core.warning(`Cancel Pages failed ${d?.id}: ${e.message}`);
}
}
}
} catch (e) {
core.warning(`Pages API not available: ${e.message}`);
}
20 changes: 20 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docs
on:
push:
branches: [ master ]
permissions: { contents: read, pages: write, id-token: write }
concurrency: { group: pages, cancel-in-progress: true }
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.x" }
- run: python -m pip install --upgrade pip
- run: pip install mkdocs mkdocs-material mkdocs-glightbox mkdocs-macros-plugin mkdocs-git-revision-date-localized-plugin
- run: mkdocs build
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with: { path: site }
- uses: actions/deploy-pages@v4
67 changes: 67 additions & 0 deletions .github/workflows/exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Exports (DOCX/EPUB/ZIP)
on:
push: { branches: [ master ] }
workflow_dispatch: {}
permissions:
contents: write
concurrency:
group: exports-${{ github.ref }}
cancel-in-progress: true

jobs:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }

# 1) Zbuduj scalony MD i stronę
- uses: actions/setup-node@v4
with: { node-version: "20" }
- run: npm install js-yaml glob --no-save
- run: node scripts/concat-md.mjs mkdocs.yml OTCv8-Docs.md

- uses: actions/setup-python@v5
with: { python-version: "3.x" }
- run: python -m pip install --upgrade pip
- run: |
pip install \
mkdocs \
mkdocs-material \
mkdocs-glightbox \
mkdocs-macros-plugin \
mkdocs-git-revision-date-localized-plugin
- run: mkdocs build

# 2) Eksporty
- run: |
sudo apt-get update && sudo apt-get install -y pandoc zip
mkdir -p docs/downloads
pandoc OTCv8-Docs.md -o docs/downloads/OTCv8-Docs.docx
pandoc OTCv8-Docs.md -o docs/downloads/OTCv8-Docs.epub --toc
zip -r docs/downloads/site.zip site
ls -lh docs/downloads

# 3) Commit TYLKO artefaktów (bez workflowów) + twardy reset do origin/master
- name: Commit downloads (clean, no-workflows)
shell: bash
run: |
set -e
git config user.name "github-actions"
git config user.email "actions@github.com"

# wyzeruj lokalny stan na zdalnym, żeby nie było "unstaged changes"
git fetch origin master
git reset --hard origin/master
git clean -fd

# dodaj WYŁĄCZNIE pliki z downloads
git add -f docs/downloads/OTCv8-Docs.docx docs/downloads/OTCv8-Docs.epub docs/downloads/site.zip

# sanity: upewnij się, że nie ma zmian w .github/workflows
if ! git diff --cached --name-only | grep -v '^.github/workflows/' >/dev/null; then
echo "OK: brak zmian w workflowach"
fi

git commit -m "export: DOCX/EPUB/ZIP" || echo "no changes"
git push
26 changes: 26 additions & 0 deletions .github/workflows/fix-md.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fix Markdown (manual)
on:
workflow_dispatch: {}
permissions: { contents: write }

jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm install prettier markdownlint-cli@0 glob@10 --no-save
- run: node scripts/fix-md.mjs
- run: npx prettier --write "docs/**/*.md"
- run: npx markdownlint --fix "docs/**/*.md" || true
- name: Commit fixes
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add -A
git restore --staged docs/build || true
git restore --staged site || true
git commit -m "chore(md): auto-fix formatting" || echo "no changes"
git push
88 changes: 88 additions & 0 deletions .github/workflows/pages-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Cleanup GitHub Pages queue
on:
workflow_dispatch: {}

permissions:
actions: write
contents: read
pages: write

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cancel queued/in_progress runs of Pages workflow
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo?.owner ? context.repo : (() => {
const [o,r] = (process.env.GITHUB_REPOSITORY||'').split('/');
return { owner:o, repo:r };
})();
if (!owner || !repo) core.setFailed('owner/repo undefined');

// znajdź workflow zawierający pages deploy (zmień jeśli używasz innej nazwy)
const workflows = await github.paginate(github.rest.actions.listRepoWorkflows, { owner, repo, per_page:100 });
const pagesWf = workflows.find(w =>
w.path.endsWith('/pages.yml') ||
/deploy.*pages/i.test(w.name||'') ||
/pages/i.test(w.name||'')
);
if (!pagesWf) {
core.notice('Nie znaleziono workflowu Pages (pages.yml) – pomijam runs.');
} else {
for (const status of ['queued','in_progress']) {
for await (const resp of github.paginate.iterator(
github.rest.actions.listWorkflowRuns,
{ owner, repo, workflow_id: pagesWf.id, status, per_page: 100 }
)) {
const runs = resp.data?.workflow_runs || [];
for (const run of runs) {
core.info(`Cancel run ${run.id} (${status})`);
await github.rest.actions.cancelWorkflowRun({ owner, repo, run_id: run.id });
await new Promise(r => setTimeout(r, 150));
}
}
}
// usuń zakończone runy tego samego workflowu
for await (const resp of github.paginate.iterator(
github.rest.actions.listWorkflowRuns,
{ owner, repo, workflow_id: pagesWf.id, status: 'completed', per_page: 100 }
)) {
const runs = resp.data?.workflow_runs || [];
for (const run of runs) {
core.info(`Delete completed run ${run.id}`);
await github.rest.actions.deleteWorkflowRun({ owner, repo, run_id: run.id });
await new Promise(r => setTimeout(r, 100));
}
}
}

- name: Cancel active GitHub Pages deployments
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo?.owner ? context.repo : (() => {
const [o,r] = (process.env.GITHUB_REPOSITORY||'').split('/');
return { owner:o, repo:r };
})();
if (!owner || !repo) core.setFailed('owner/repo undefined');

// API Pages deployments (wymaga pages:write)
for await (const resp of github.paginate.iterator(
github.request, 'GET /repos/{owner}/{repo}/pages/deployments',
{ owner, repo, per_page: 100 }
)) {
const list = Array.isArray(resp.data) ? resp.data : (resp.data?.deployments || []);
for (const d of list) {
try {
core.info(`Cancel Pages deployment ${d.id} (${d.status})`);
await github.request('POST /repos/{owner}/{repo}/pages/deployments/{deployment_id}/cancel', {
owner, repo, deployment_id: d.id
});
await new Promise(r => setTimeout(r, 150));
} catch (e) {
core.warning(`Cancel failed ${d?.id}: ${e.message}`);
}
}
}
Loading
Loading