From 596e67c29671a0369d9e25ed1a2872f1abe1c016 Mon Sep 17 00:00:00 2001 From: Jon <66625200+Kyro3400@users.noreply.github.com> Date: Sun, 17 Nov 2024 14:58:54 -0500 Subject: [PATCH] Update validation.yml --- .github/workflows/validation.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index e040241a..6a642043 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -65,7 +65,54 @@ jobs: labels: "Validated DNS" github_token: ${{ steps.create_token.outputs.token }} + json: + name: JSON + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - id: create_token + uses: tibdex/github-app-token@v2 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.PRIVATE_KEY }} + + - name: JSON Syntax Check + id: json_check + uses: limitusus/json-syntax-check@v2 + with: + pattern: "\\.json$" + env: + BASE: "domains/" + + - name: Add Validated JSON Label + if: ${{ steps.json_check.outcome == 'success' }} + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: "Validated JSON" + github_token: ${{ steps.create_token.outputs.token }} + - name: Remove Invalid JSON Label + if: ${{ steps.json_check.outcome == 'success' }} + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "Invalid JSON" + github_token: ${{ steps.create_token.outputs.token }} + + - name: Add Invalid JSON Label + if: ${{ failure() }} + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: "Invalid JSON" + github_token: ${{ steps.create_token.outputs.token }} + - name: Remove Validated JSON Label + if: ${{ failure() }} + uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "Validated JSON" + github_token: ${{ steps.create_token.outputs.token }} + tests: name: Tests if: "!contains(github.event.head_commit.message, '[skip-ci]')"