Skip to content

Commit 39ec195

Browse files
committed
chore: ensure sync PR runs checks
1 parent 2b4e920 commit 39ec195

3 files changed

Lines changed: 115 additions & 41 deletions

File tree

.github/workflows/check-docs-updates.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: write
1010
pull-requests: write
11+
actions: write
1112

1213
jobs:
1314
sync-docs:
@@ -43,6 +44,23 @@ jobs:
4344
echo "changes=false" >> "$GITHUB_OUTPUT"
4445
fi
4546
47+
- name: Trigger Tests and Pre-commit workflows
48+
if: steps.sync_docs.outputs.changes == 'true'
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
REPO: ${{ github.repository }}
52+
BRANCH: chore/sync-affinity-docs
53+
run: |
54+
set -euo pipefail
55+
for workflow in tests.yml pre-commit.yml; do
56+
curl -X POST \
57+
-H "Accept: application/vnd.github+json" \
58+
-H "Authorization: Bearer $GITHUB_TOKEN" \
59+
-H "X-GitHub-Api-Version: 2022-11-28" \
60+
"https://api.github.com/repos/$REPO/actions/workflows/$workflow/dispatches" \
61+
-d "{\"ref\":\"$BRANCH\"}"
62+
done
63+
4664
- name: Create pull request
4765
if: steps.sync_docs.outputs.changes == 'true'
4866
uses: peter-evans/create-pull-request@v6

REPOSITORY_STRUCTURE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This document explains the repository structure and why files are organized this
1111
- `workflows/` - Actions definitions (`check-docs-updates.yml`, `tests.yml`, `pre-commit.yml`)
1212
- `scripts/validate_docs_structure.py` - Lightweight CI validation helper
1313
- `docs-version-*.json` - Metadata files used by historic workflows
14+
- **CI note**: `check-docs-updates.yml` auto-creates the `chore/sync-affinity-docs` branch/PR and then explicitly triggers `tests.yml` and `pre-commit.yml` via `workflow_dispatch` so that required checks run even though the PR is opened by a workflow.
1415

1516
**Why here?**: Keeps automation-specific assets scoped to GitHub configuration.
1617

0 commit comments

Comments
 (0)