5
5
- ' main'
6
6
paths :
7
7
- .github/workflows/publish-wiki.yml
8
+ - .github/workflows/pr-comment.yml
8
9
- build/wiki-code-samples/**
9
10
- build/wiki-command-replacer.sh
10
11
- wiki/**
11
12
# Do a dry-run (check, no deploy) for PRs.
12
13
pull_request :
13
14
paths :
14
15
- .github/workflows/publish-wiki.yml
16
+ - .github/workflows/pr-comment.yml
15
17
- build/wiki-code-samples/**
16
18
- build/wiki-command-replacer.sh
17
19
- wiki/**
38
40
permissions :
39
41
# Needed for the commit to the wiki.
40
42
contents : write
41
- # Needed for the PR comment.
42
- pull-requests : write
43
43
44
44
steps :
45
45
- name : Checkout code
@@ -126,22 +126,6 @@ jobs:
126
126
if-no-files-found : error
127
127
retention-days : 10
128
128
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
-
145
129
146
130
# ################################################################################
147
131
# Deploy to the wiki in the PHPCS repo.
@@ -153,6 +137,7 @@ jobs:
153
137
git_threshold : partial_outage
154
138
155
139
- name : Deploy to wiki
140
+ if : ${{ github.event_name != 'pull_request' }}
156
141
uses :
Andrew-Chen-Wang/[email protected]
157
142
env :
158
143
COMMIT_MSG : ${{ github.event.head_commit.message }}
@@ -166,3 +151,31 @@ jobs:
166
151
dry-run : ${{ github.event_name == 'pull_request' }}
167
152
disable-empty-commits : true
168
153
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