From 1d243a17d048a752972059b9b70ab504c04578ab Mon Sep 17 00:00:00 2001 From: Jon <66625200+Kyro3400@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:17:36 -0500 Subject: [PATCH] Update validation.yml --- .github/workflows/validation.yml | 123 ++++++++----------------------- 1 file changed, 30 insertions(+), 93 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 8032e34e..716a6a3e 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -1,104 +1,41 @@ name: Validation on: - pull_request_target: + pull_request: + + push: + branches: [main] + paths: + - "domains/*" + - "tests/*" + - "utils/*" + - ".github/workflows/validate.yml" + - "dnsconfig.js" + + workflow_dispatch: concurrency: - group: ${{ github.ref }}-validation - cancel-in-progress: true + group: ${{ github.ref }}-validation + cancel-in-progress: true jobs: - dns: - name: DNS - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} + dns: + name: DNS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - id: create_token - uses: tibdex/github-app-token@v2 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.PRIVATE_KEY }} + - name: Check + uses: is-a-dev/dnscontrol-action@main + with: + args: check - - name: Check DNS - id: dns_check - uses: koenrh/dnscontrol-action@v3 - with: - args: check - config_file: "dnsconfig.js" + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - name: Add Validated DNS Label - if: ${{ steps.dns_check.outcome == 'success' }} - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: "Validated DNS" - github_token: ${{ steps.create_token.outputs.token }} - - name: Remove Invalid DNS Label - if: ${{ steps.dns_check.outcome == 'success' }} - uses: actions-ecosystem/action-remove-labels@v1 - with: - labels: "Invalid DNS" - github_token: ${{ steps.create_token.outputs.token }} + - run: npm install - - name: Add Invalid DNS Label - if: ${{ failure() }} - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: "Invalid DNS" - github_token: ${{ steps.create_token.outputs.token }} - - name: Remove Validated DNS Label - if: ${{ failure() }} - uses: actions-ecosystem/action-remove-labels@v1 - with: - 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 }} + - run: npm test