mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-07-21 14:04:29 +02:00
Merge pull request #2 from Andre601/feature/wiki-improve-validation
Feature/wiki improve validation
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# A separate Workflow to comment on Pull requests
|
||||||
|
# for failed Wiki validation runs.
|
||||||
|
#
|
||||||
|
# This is to avoid code execution injected by
|
||||||
|
# extensions, plugins or hooks in MkDocs, that could
|
||||||
|
# abuse write permissions.
|
||||||
|
#
|
||||||
|
name: "Comment on failed Validation"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- "Validate Wiki Build"
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
comment:
|
||||||
|
if: github.event.workflow_run.conclusion == 'failure'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Comment on Pull request
|
||||||
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.workflow_run.pull_requests[0].number }}
|
||||||
|
body: |
|
||||||
|
## Build validation failed
|
||||||
|
|
||||||
|
Something went wrong while running a test-build with this Pull request's changes.
|
||||||
|
Please check the [Workflow Run Logs](${{ github.event.workflow_run.html_url }}) for any details.
|
||||||
+1
-13
@@ -19,7 +19,6 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}"
|
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}"
|
||||||
@@ -33,6 +32,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: "${{ github.event.pull_request.head.sha }}"
|
ref: "${{ github.event.pull_request.head.sha }}"
|
||||||
|
persist-credentials: false
|
||||||
- name: "Setup Python 3.x"
|
- name: "Setup Python 3.x"
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
@@ -41,15 +41,3 @@ jobs:
|
|||||||
run: "python -m pip install mkdocs-material"
|
run: "python -m pip install mkdocs-material"
|
||||||
- name: "Build Site"
|
- name: "Build Site"
|
||||||
run: "mkdocs build --strict"
|
run: "mkdocs build --strict"
|
||||||
- name: "Create Comment"
|
|
||||||
uses: peter-evans/create-or-update-comment@v5
|
|
||||||
if: ${{ failure() }}
|
|
||||||
with:
|
|
||||||
body: |-
|
|
||||||
## Wiki Build failure
|
|
||||||
|
|
||||||
Something went wrong while creating a test-build of the Wiki for this Pull request.
|
|
||||||
Please check the [Workflow Logs](${{ env.RUN_URL }}) for any errors.
|
|
||||||
issue-number: "${{ github.event.pull_request.number }}"
|
|
||||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
edit-mode: replace
|
|
||||||
Reference in New Issue
Block a user