Merge pull request #47383 from Kesav2k04/register-kj #64668
This file contains hidden or 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
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "domains/*" | |
| - "tests/*" | |
| - "util/*" | |
| - ".github/workflows/ci.yml" | |
| - "package.json" | |
| - "package-lock.json" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.ref }}-ci | |
| jobs: | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - run: npm ci | |
| - name: Fetch PR information | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "PR_AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV | |
| echo "PR_AUTHOR_ID=${{ github.event.pull_request.user.id }}" >> $GITHUB_ENV | |
| LABELS=$(gh api --jq '[.labels[].name]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}) | |
| echo "PR_LABELS=$LABELS" >> $GITHUB_ENV | |
| FILES=$(gh api --jq '[.[] | select(.status != "removed") | .filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files) | |
| echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV | |
| REMOVED_FILE_DATA=$(gh api --jq '[.[] | select(.status == "removed") | {name: .filename, data: .patch}]' /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files) | |
| echo "DELETED_FILES=$REMOVED_FILE_DATA" >> $GITHUB_ENV | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - uses: gacts/install-dnscontrol@890ba3249712c51203ccb7aba63307c0091e921b # v1.3.4 | |
| if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js') | |
| with: | |
| version: 4.14.0 | |
| - name: Run DNSControl checks | |
| run: dnscontrol check | |
| if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js') | |
| - name: Run tests | |
| run: npx ava tests/*.test.js --timeout=1m |