Add comment to PR when done #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- main | |
name: Validate JSON | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Delete previous comment | |
uses: izhangzhihao/delete-comment@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
delete_user_name: github-actions[bot] | |
issue_number: ${{ github.event.number }} | |
- uses: actions/checkout@v3 | |
- name: Validate Category JSON | |
uses: dsanders11/json-schema-validate-action@v1.1.0 | |
with: | |
schema: ".schema/category.json" | |
files: "*/config.json" | |
- name: Validate Manufacturer JSON | |
uses: dsanders11/json-schema-validate-action@v1.1.0 | |
with: | |
schema: ".schema/manufacturer.json" | |
files: "*/*/config.json" | |
- name: Validate Controller JSON | |
uses: dsanders11/json-schema-validate-action@v1.1.0 | |
with: | |
schema: ".schema/controller.json" | |
files: "*/*/*/config.json" | |
- name: Comment PR | |
if: failure() | |
uses: thollander/actions-comment-pull-request@v2.5.0 | |
with: | |
message: | | |
Validation of the JSON files has failed, please check the [Github Action log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see why |