File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77permissions :
88 contents : read
99 pull-requests : write
10+ statuses : write
1011
1112jobs :
1213 build :
3536 const touchesDocs = files.some(f => f.filename.startsWith('docs/'));
3637 if (touchesDocs) return; // docs PRs are handled by stage-progression.yml
3738
39+ // Flip the review-workflow commit status to success so branch
40+ // protection allows merge. This is the non-docs counterpart to
41+ // stage-progression.yml's status-setting for docs PRs.
42+ const headSha = context.payload.pull_request.head.sha;
43+ await github.rest.repos.createCommitStatus({
44+ owner: context.repo.owner,
45+ repo: context.repo.repo,
46+ sha: headSha,
47+ state: 'success',
48+ context: 'review-workflow',
49+ description: 'No doc changes — admin may merge',
50+ });
51+
3852 const marker = '<!-- ci-admin-merge-bot-comment -->';
39- const sha = context.payload.pull_request.head.sha .substring(0, 7);
53+ const sha = headSha .substring(0, 7);
4054 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.`;
4155 const comments = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber });
4256 const existing = comments.data.find(c => c.user.type === 'Bot' && c.body.includes(marker));
Original file line number Diff line number Diff line change 3636 env :
3737 DOCUSAURUS_URL : https://usace-rmc.github.io
3838 DOCUSAURUS_BASE_URL : /RMC-Software-Documentation-Previews/pr-${{ github.event.pull_request.number }}/
39+ DOCUSAURUS_IS_PREVIEW : ' true'
3940 run : npm run build
4041 - uses : peaceiris/actions-gh-pages@v4
4142 with :
Original file line number Diff line number Diff line change @@ -89,14 +89,20 @@ export default {
8989 ] ,
9090
9191 plugins : [
92- // Google Analytics plugin
93- [
94- '@docusaurus/plugin-google-gtag' ,
95- {
96- trackingID : 'G-LB2BWWGDTB' ,
97- anonymizeIP : true ,
98- } ,
99- ] ,
92+ // Google Analytics plugin — production builds only.
93+ // Preview builds set DOCUSAURUS_IS_PREVIEW=true so they don't pollute
94+ // the production GA property with pr-preview page views.
95+ ...( process . env . DOCUSAURUS_IS_PREVIEW === 'true'
96+ ? [ ]
97+ : [
98+ [
99+ '@docusaurus/plugin-google-gtag' ,
100+ {
101+ trackingID : 'G-LB2BWWGDTB' ,
102+ anonymizeIP : true ,
103+ } ,
104+ ] ,
105+ ] ) ,
100106
101107 // TailwindCSS as a custom plugin
102108 tailwindPlugin ,
You can’t perform that action at this time.
0 commit comments