Skip to content

ci(em-dash): eradicate em-dashes from v3.4 mirror, fix broken links #73

ci(em-dash): eradicate em-dashes from v3.4 mirror, fix broken links

ci(em-dash): eradicate em-dashes from v3.4 mirror, fix broken links #73

name: Cross-Repo Consistency
on:
push:
branches: [main]
paths:
- 'publications/papers/markdown/*.md'
- '.github/scripts/cross_repo_check.py'
- '.github/workflows/cross-repo-consistency.yml'
pull_request:
branches: [main]
paths:
- 'publications/papers/markdown/*.md'
- '.github/scripts/cross_repo_check.py'
- '.github/workflows/cross-repo-consistency.yml'
# Triggered by repository_dispatch from gift-framework/core
repository_dispatch:
types: [core-updated]
workflow_dispatch:
# Weekly check to catch drift
schedule:
- cron: '0 6 * * 1' # Every Monday at 6 AM UTC
jobs:
cross-repo-check:
runs-on: ubuntu-latest
name: Check Consistency with gift-framework/core
steps:
- name: Checkout GIFT (docs)
uses: actions/checkout@v4
with:
path: gift-docs
- name: Checkout gift-framework/core
uses: actions/checkout@v4
with:
repository: gift-framework/core
path: gift-core
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Run cross-repo consistency check
run: |
cd gift-docs
python .github/scripts/cross_repo_check.py --core-path ../gift-core
- name: Upload consistency report
uses: actions/upload-artifact@v4
if: always()
with:
name: cross-repo-consistency-report
path: gift-docs/cross_repo_report.json
retention-days: 30
notify-on-failure:
runs-on: ubuntu-latest
needs: cross-repo-check
if: failure()
steps:
- name: Create issue on failure
uses: actions/github-script@v7
with:
script: |
const title = 'Cross-Repo Consistency Check Failed';
const body = `The cross-repo consistency check between GIFT docs and gift-framework/core has failed.
**Workflow run:** ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}
Please review the consistency report artifact and update the documentation to match the verified values in gift-framework/core.`;
// Check if issue already exists
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'ci-failure'
});
const existingIssue = issues.data.find(i => i.title === title);
if (!existingIssue) {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
labels: ['ci-failure', 'documentation']
});
}