mirror of
https://github.com/tiennm99/is-amazing.git
synced 2026-10-11 08:59:58 +00:00
37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
name: Check JSON on PR
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'domains/**/*.json'
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v2
|
|
- name: json-yaml-validate
|
|
id: json-yaml-validate
|
|
uses: GrantBirki/json-yaml-validate@v2.4.0
|
|
with:
|
|
base_dir: './domains'
|
|
json_schema: '.github/workflows/domain-schema.json'
|
|
continue-on-error: true
|
|
- name: Comment on PR
|
|
if: ${{ steps.json-yaml-validate.outcome == 'failure' }}
|
|
uses: actions/github-script@v5
|
|
with:
|
|
github-token: ${{ secrets.MY_GITHUB_TOKEN }} # use the created secret token
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: "❌ JSON validation failed!"
|
|
});
|