From 4e8ba665c78e30e30d39ae88a22076dbb26ca1b1 Mon Sep 17 00:00:00 2001 From: Joab <89288499+Joabutt@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:13:14 +0800 Subject: [PATCH] Update check_pr.yml --- .github/workflows/check_pr.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index e8efd28..f7aa75a 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -6,8 +6,8 @@ on: permissions: contents: read - pull-requests: write # enable write permissions for pull request comments - issues: write # pull requests are just issues with extra features + pull_requests: write + issues: write jobs: build: @@ -21,5 +21,15 @@ jobs: with: base_dir: './domains' json_schema: '.github/workflows/domain-schema.json' - comment: "true" # enable comment mode - token: ${{ secrets.MY_GITHUB_TOKEN }} # Use your PAT + continue-on-error: true + - name: Comment on PR + if: ${{ steps.json-yaml-validate.outcome == 'failure' }} + uses: actions/github-script@v5 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "❌ JSON validation failed!" + });