Skip to content

Commit 640eb6b

Browse files
committed
ADD TO: publish action / post comment about available artifact
1 parent 4ee9178 commit 640eb6b

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/publish-wiki.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ concurrency:
2424
group: "publish-wiki"
2525
cancel-in-progress: false
2626

27-
permissions:
28-
contents: write
29-
3027
jobs:
3128
publish-wiki:
3229
name: "Publish Wiki"
3330
if: github.repository == 'PHPCSStandards/PHP_CodeSniffer-documentation'
3431

3532
runs-on: ubuntu-latest
3633

34+
permissions:
35+
# Needed for the commit to the wiki.
36+
contents: write
37+
# Needed for the PR comment.
38+
pull-requests: write
39+
3740
steps:
3841
- name: Checkout code
3942
uses: actions/checkout@v4
@@ -56,13 +59,29 @@ jobs:
5659
# is updated. All in all, no need to keep the artifact for more than a few days.
5760
- name: "[PR only] Upload the preprocessed wiki files as an artifact"
5861
if: ${{ github.event_name == 'pull_request' }}
62+
id: artifact
5963
uses: actions/upload-artifact@v4
6064
with:
6165
name: wiki-files
6266
path: ./_wiki
6367
if-no-files-found: error
6468
retention-days: 10
6569

70+
- name: "[PR only] Post comment to review artifact if workflow was updated"
71+
if: ${{ github.event_name == 'pull_request' }}
72+
uses: mshick/add-pr-comment@v2
73+
with:
74+
# TODO: replace this with PAT
75+
repo-token: ${{ secrets.PHPCS_GITHUB_TOKEN }}
76+
message: |
77+
Thank you for this PR.
78+
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.
79+
80+
Please review the resulting final markdown files via the [created artifact](${{ steps.artifact.outputs.artifact-url }}).
81+
This is especially important when adding new pages or updating auto-generated output blocks.
82+
83+
_N.B.: the above link will automatically be updated when this PR is updated._
84+
6685
- name: Check GitHub Git Operations status
6786
uses: crazy-max/ghaction-github-status@v4
6887
with:

0 commit comments

Comments
 (0)