Skip to content

Commit 4f3adb5

Browse files
authored
Merge pull request #109 from USACE-RMC/enhancement/automated-review-workflow
Add individual reviewer gating and merge-gate status to review workflow
2 parents 7714617 + 10ebe77 commit 4f3adb5

5 files changed

Lines changed: 376 additions & 38 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
pull-requests: write
910

1011
jobs:
1112
build:
@@ -19,3 +20,28 @@ jobs:
1920
cache: 'npm'
2021
- run: npm ci
2122
- run: npm run build
23+
- name: Signal admin-may-merge for non-docs PRs
24+
if: success()
25+
uses: actions/github-script@v7
26+
with:
27+
script: |
28+
const prNumber = context.payload.pull_request.number;
29+
const files = await github.paginate(github.rest.pulls.listFiles, {
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
pull_number: prNumber,
33+
per_page: 100,
34+
});
35+
const touchesDocs = files.some(f => f.filename.startsWith('docs/'));
36+
if (touchesDocs) return; // docs PRs are handled by stage-progression.yml
37+
38+
const marker = '<!-- ci-admin-merge-bot-comment -->';
39+
const sha = context.payload.pull_request.head.sha.substring(0, 7);
40+
const body = `${marker}\n\n✅ **CI build passed** for commit \`${sha}\`\n\nThis PR does not touch documentation content under \`docs/\`, so no multi-stage review is required.\n\n@usace-rmc/docs-admin may merge.`;
41+
const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber });
42+
const existing = comments.data.find(c => c.user.type === 'Bot' && c.body.includes(marker));
43+
if (existing) {
44+
await github.rest.issues.updateComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: existing.id, body });
45+
} else {
46+
await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber, body });
47+
}

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'src/**'
9+
- 'static/**'
10+
- 'docusaurus.config.js'
11+
- 'tailwind.config.js'
12+
- 'package.json'
13+
- 'package-lock.json'
14+
- 'scripts/**'
615
workflow_dispatch:
716
inputs:
817
ref:

.github/workflows/pr-preview.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ permissions:
1717
contents: read
1818
pull-requests: write
1919

20+
concurrency:
21+
group: pr-preview-${{ github.event.pull_request.number }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125
build-and-deploy:
2226
name: Build and deploy preview

0 commit comments

Comments
 (0)