-
Notifications
You must be signed in to change notification settings - Fork 23
41 lines (34 loc) · 1.25 KB
/
pr-markdown.yml
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
39
40
41
name: Markdown Validation
on:
pull_request:
branches: [main, develop]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@dc0413987a085fa17d19df9e47d4677cf81ffef3 #v3.0.0
with:
application_id: ${{ secrets.ADVANCED_SECURITY_APP_ID }}
application_private_key: ${{ secrets.ADVANCED_SECURITY_APP_KEY }}
- name: Generate Markdown
uses: advanced-security/secret-scanning-tools@v1
with:
mode: markdown
token: ${{ steps.get_workflow_token.outputs.token }}
- name: Check git status
env:
GH_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
run: |
if [ -z "$(git status --porcelain)" ]; then
gh pr comment --edit-last ${{ github.event.number }} \
--body "## :white_check_mark: Markdown Validation Passed :rocket:!" || true
exit 0
else
PR_BODY=$'## :x: Markdown Failed\n\nPlease re-run the markdown generation \`pipenv run markdown\`'
gh pr comment ${{ github.event.number }} \
--body "$PR_BODY"
exit 1
fi