forked from AvengeMedia/dms-plugin-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 990 Bytes
/
comment-validation.yml
File metadata and controls
38 lines (32 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Comment Validation Errors
on:
workflow_run:
workflows: ["Validate Pull Request"]
types:
- completed
permissions:
pull-requests: write
jobs:
comment:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'failure'
steps:
- name: Download validation output
id: download
uses: actions/download-artifact@v7
continue-on-error: true
with:
name: validation-result
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR
if: steps.download.outcome == 'success'
run: |
PR_NUMBER=$(cat pr-number.txt)
BODY=$(sed 's/\x1b\[[0-9;]*m//g' validate-links-output.txt)
gh pr comment "$PR_NUMBER" --repo "${{ github.repository }}" --body "### Plugin validation failed
\`\`\`
$BODY
\`\`\`"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}