Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
caee20e
ci: add smart PR workflow automation
ndycode Mar 14, 2026
d4ca444
ci: split required PR validation lanes
ndycode Mar 14, 2026
ed57187
ci: address PR review edge cases
ndycode Mar 14, 2026
4d90271
ci: harden docs-check markdown parsing
ndycode Mar 14, 2026
76b4d7f
test: cover docs-check link validation
ndycode Mar 14, 2026
b3dce2c
fix: tighten docs-check and advisory PR lanes
ndycode Mar 14, 2026
18ec2e3
fix: bound workflow gates and test temp roots
ndycode Mar 14, 2026
0d2c612
fix: harden PR governance and docs checks
ndycode Mar 14, 2026
3c1de9f
fix: tighten docs-check root boundaries
ndycode Mar 14, 2026
44e2b19
fix: add workflow timeout guards
ndycode Mar 14, 2026
08226fb
fix: scope workflow badge checks
ndycode Mar 14, 2026
f1a8dfc
fix: address docs check review follow-ups
ndycode Mar 14, 2026
4f2df69
fix: ignore html comment links in docs check
ndycode Mar 15, 2026
ec4e852
Add CI timeout and clarify advisory/test intent
ndycode Mar 15, 2026
f3338da
Run docs-sanity when CI scripts change
ndycode Mar 15, 2026
b949784
Harden docs-check link validation contract
ndycode Mar 15, 2026
df1bc68
Add Windows advisory compat lane
ndycode Mar 15, 2026
38fe3c3
Harden PR governance verification gating
ndycode Mar 15, 2026
e4e16fd
Cover docs-check discovery paths and clear stale live labels
ndycode Mar 15, 2026
effb3a0
Pin pr governance action and decode docs links
ndycode Mar 15, 2026
98d09be
Tighten stale live label cleanup
ndycode Mar 15, 2026
3b726f4
Pin workflow action tags and cover empty docs run
ndycode Mar 15, 2026
70247a9
Pin advisory artifact action and cover docs failures
ndycode Mar 15, 2026
45f2bb2
Harden docs-check portability and CI routing
ndycode Mar 15, 2026
66bf42c
Tighten CI review follow-ups
ndycode Mar 15, 2026
e02bb4b
chore: tighten workflow review edge cases
ndycode Mar 15, 2026
c16622f
chore: isolate governance event concurrency
ndycode Mar 15, 2026
8288daf
ci: harden PR review follow-ups
ndycode Mar 15, 2026
85895c4
ci: summarize advisory compat failures
ndycode Mar 15, 2026
1e96992
ci: harden governance body parsing
ndycode Mar 15, 2026
f305221
ci: harden governance body parsing
ndycode Mar 15, 2026
d16b767
test: cover shortcut docs references
ndycode Mar 15, 2026
64afc50
test: tighten shortcut reference parsing
ndycode Mar 15, 2026
2681483
ci: serialize PR governance runs
ndycode Mar 15, 2026
4d1be96
ci: harden governance fence parsing
ndycode Mar 15, 2026
19dabaf
ci: fix governance and docs-check edge cases
ndycode Mar 15, 2026
3a967e1
fix: harden governance summary and docs-check retries
ndycode Mar 15, 2026
d4974b5
Harden docs-check fence parsing
ndycode Mar 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@
## Testing

- [ ] `npm run lint`
- [ ] `npm run typecheck`
- [ ] `npm run build`
- [ ] `npm test`
- [ ] `npm run docs:check`
- [ ] Not applicable

## Docs Impact

- [ ] README or docs updated
- [ ] No docs changes needed

## Compliance Confirmation

- [ ] This change stays within the repository scope and OpenAI Terms of Service expectations.
- [ ] This change uses official authentication flows only and does not add bypass, scraping, or credential-sharing behavior.
- [ ] I updated tests and documentation when the change affected users, maintainers, or repository behavior.
- [ ] No auth, request-routing, or storage paths changed.
- [ ] I manually tested with a real ChatGPT Plus/Pro account.
- Maintainers can apply the `maintainer-live-verified` label after independent live verification.

## Notes

Expand Down
335 changes: 335 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,335 @@
name: CI

on:
pull_request:
push:
branches:
- main
merge_group:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CI: true
HUSKY: 0

jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
code_changed: ${{ steps.detect.outputs.code_changed }}
docs_changed: ${{ steps.detect.outputs.docs_changed }}
workflow_changed: ${{ steps.detect.outputs.workflow_changed }}
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0

- name: Classify changed files
id: detect
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
BASE_REF: ${{ github.base_ref }}
BEFORE_SHA: ${{ github.event.before }}
run: |
set -euo pipefail

docs_changed=false
code_changed=false
workflow_changed=false
files=()

collect_changed_files() {
local range="$1"

while IFS=$'\t' read -r status first_path second_path; do
[[ -z "${status}" ]] && continue

case "${status}" in
R*|C*)
[[ -n "${first_path}" ]] && files+=("${first_path}")
[[ -n "${second_path}" ]] && files+=("${second_path}")
;;
*)
[[ -n "${first_path}" ]] && files+=("${first_path}")
;;
esac
done < <(git diff --find-renames --name-status "${range}")
}

if [[ "${EVENT_NAME}" == "pull_request" ]]; then
git fetch --no-tags --depth=1 origin "${BASE_REF}"
collect_changed_files "origin/${BASE_REF}...HEAD"
elif [[ "${EVENT_NAME}" == "push" && -n "${BEFORE_SHA}" && "${BEFORE_SHA}" != "0000000000000000000000000000000000000000" ]]; then
collect_changed_files "${BEFORE_SHA}...HEAD"
else
# No reliable diff range is available on this event. docs_changed and
# code_changed are forced below, and workflow_changed intentionally
# stays false unless an actual diff classified workflow files.
:
fi

for file in "${files[@]}"; do
[[ -z "${file}" ]] && continue
is_docs_markdown=false

if [[ "${file}" =~ ^(README\.md|CONTRIBUTING\.md|CHANGELOG\.md|SECURITY\.md)$ ]] || [[ "${file}" =~ ^(\.github|config|docs|test)/.+\.(md|markdown)$ ]]; then
docs_changed=true
is_docs_markdown=true
fi

case "${file}" in
scripts/ci/*)
docs_changed=true
code_changed=true
;;
.github/workflows/*)
workflow_changed=true
code_changed=true
;;
*)
if [[ "${is_docs_markdown}" != "true" ]]; then
code_changed=true
fi
;;
esac
done

if [[ "${EVENT_NAME}" != "pull_request" ]]; then
# Run full docs/code lanes on non-PR events, but keep workflow_changed
# diff-based so actionlint only runs when workflow files actually change.
docs_changed=true
code_changed=true
fi

{
echo "docs_changed=${docs_changed}"
echo "code_changed=${code_changed}"
echo "workflow_changed=${workflow_changed}"
} >> "${GITHUB_OUTPUT}"

lint:
name: lint
needs: changes
if: needs.changes.outputs.code_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

typecheck:
name: typecheck
needs: changes
if: needs.changes.outputs.code_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Type check
run: npm run typecheck

build:
name: build
needs: changes
if: needs.changes.outputs.code_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

unit-linux:
name: unit (linux)
needs: changes
if: needs.changes.outputs.code_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

unit-windows:
name: unit (windows)
needs: changes
if: needs.changes.outputs.code_changed == 'true'
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --reporter=verbose

docs-sanity:
name: docs-sanity
needs: changes
if: needs.changes.outputs.docs_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version-file: .nvmrc

# docs-check.js is intentionally limited to Node built-ins, so this lane can skip npm ci.
- name: Verify markdown links and CI badge targets
run: npm run docs:check

actionlint:
name: actionlint
needs: changes
if: needs.changes.outputs.workflow_changed == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Lint GitHub Actions workflows
uses: docker://rhysd/actionlint@sha256:5457037ba91acd225478edac3d4b32e45cf6c10291e0dabbfd2491c63129afe1 # rhysd/actionlint:1.7.11 linux/amd64
with:
args: -color

required-pr:
name: required-pr
needs:
- changes
- lint
- typecheck
- build
- unit-linux
- unit-windows
- docs-sanity
- actionlint
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Evaluate required checks
shell: bash
env:
CHANGES_RESULT: ${{ needs.changes.result }}
CODE_CHANGED: ${{ needs.changes.outputs.code_changed }}
DOCS_CHANGED: ${{ needs.changes.outputs.docs_changed }}
WORKFLOW_CHANGED: ${{ needs.changes.outputs.workflow_changed }}
LINT_RESULT: ${{ needs.lint.result }}
TYPECHECK_RESULT: ${{ needs.typecheck.result }}
BUILD_RESULT: ${{ needs.build.result }}
UNIT_LINUX_RESULT: ${{ needs.unit-linux.result }}
UNIT_WINDOWS_RESULT: ${{ needs.unit-windows.result }}
DOCS_RESULT: ${{ needs.docs-sanity.result }}
ACTIONLINT_RESULT: ${{ needs.actionlint.result }}
run: |
set -euo pipefail
failures=()

if [[ "${CHANGES_RESULT}" != "success" ]]; then
echo "Changes detection job did not succeed (result: ${CHANGES_RESULT}). Failing gate."
exit 1
fi

if [[ "${CODE_CHANGED}" == "true" && "${LINT_RESULT}" != "success" ]]; then
failures+=("lint")
fi

if [[ "${CODE_CHANGED}" == "true" && "${TYPECHECK_RESULT}" != "success" ]]; then
failures+=("typecheck")
fi

if [[ "${CODE_CHANGED}" == "true" && "${BUILD_RESULT}" != "success" ]]; then
failures+=("build")
fi

if [[ "${CODE_CHANGED}" == "true" && "${UNIT_LINUX_RESULT}" != "success" ]]; then
failures+=("unit-linux")
fi

if [[ "${CODE_CHANGED}" == "true" && "${UNIT_WINDOWS_RESULT}" != "success" ]]; then
failures+=("unit-windows")
fi

if [[ "${DOCS_CHANGED}" == "true" && "${DOCS_RESULT}" != "success" ]]; then
failures+=("docs-sanity")
fi

if [[ "${WORKFLOW_CHANGED}" == "true" && "${ACTIONLINT_RESULT}" != "success" ]]; then
failures+=("actionlint")
fi

if [[ ${#failures[@]} -gt 0 ]]; then
echo "Required checks failed: ${failures[*]}"
exit 1
fi

echo "All required PR checks passed."
Loading