55 - ' main'
66 paths :
77 - .github/workflows/publish-wiki.yml
8+ - .github/workflows/pr-comment.yml
89 - build/wiki-code-samples/**
910 - build/wiki-command-replacer.sh
1011 - wiki/**
1112 # Do a dry-run (check, no deploy) for PRs.
1213 pull_request :
1314 paths :
1415 - .github/workflows/publish-wiki.yml
16+ - .github/workflows/pr-comment.yml
1517 - build/wiki-code-samples/**
1618 - build/wiki-command-replacer.sh
1719 - wiki/**
3840 permissions :
3941 # Needed for the commit to the wiki.
4042 contents : write
41- # Needed for the PR comment.
42- pull-requests : write
4343
4444 steps :
4545 - name : Checkout code
@@ -126,22 +126,6 @@ jobs:
126126 if-no-files-found : error
127127 retention-days : 10
128128
129- - name : " [PR only] Post comment to review artifact"
130- if : ${{ github.event_name == 'pull_request' }}
131- uses : mshick/add-pr-comment@v2
132- with :
133- repo-token : ${{ secrets.COMMENT_ON_PRS_TOKEN }}
134- message : |
135- **_=== This is an auto-generated comment ===_**
136-
137- Thank you for your PR.
138- A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.
139-
140- Please review the resulting final markdown files via the [created artifact](${{ steps.artifact.outputs.artifact-url }}).
141- This is especially important when adding new pages or updating auto-generated output blocks.
142-
143- _N.B.: the above link will automatically be updated when this PR is updated._
144-
145129
146130 # ################################################################################
147131 # Deploy to the wiki in the PHPCS repo.
@@ -153,6 +137,7 @@ jobs:
153137 git_threshold : partial_outage
154138
155139 - name : Deploy to wiki
140+ if : ${{ github.event_name != 'pull_request' }}
156141 uses :
Andrew-Chen-Wang/[email protected] 157142 env :
158143 COMMIT_MSG : ${{ github.event.head_commit.message }}
@@ -166,3 +151,31 @@ jobs:
166151 dry-run : ${{ github.event_name == 'pull_request' }}
167152 disable-empty-commits : true
168153 preprocess : false
154+
155+
156+ # ################################################################################
157+ # Dry-run/PRs: save PR info for use in Pull Request Comment workflow.
158+ # ################################################################################
159+
160+ - name : Create temporary directory
161+ if : ${{ github.event_name == 'pull_request' }}
162+ run : mkdir -p ./pr
163+
164+ - name : Save PR number
165+ if : ${{ github.event_name == 'pull_request' }}
166+ env :
167+ PR_NUMBER : ${{ github.event.number }}
168+ run : echo "${PR_NUMBER}" > ./pr/pr_number
169+
170+ - name : Save artifact URL
171+ if : ${{ github.event_name == 'pull_request' }}
172+ env :
173+ ARTIFACT_URL : ${{ steps.artifact.outputs.artifact-url }}
174+ run : echo "${ARTIFACT_URL}" > ./pr/artifact_url
175+
176+ - name : Upload PR info as artifact
177+ if : ${{ github.event_name == 'pull_request' }}
178+ uses : actions/upload-artifact@v4
179+ with :
180+ name : pr_info
181+ path : pr/
0 commit comments