Files
is-a-dev/.github/workflows/ci.yml
T
DIBSTER 8d19ccbcb2 ci(workflows): pin github actions to commit hashes
Updated all GitHub Actions dependencies across workflows to use full commit SHAs instead of mutable version tags (e.g., `actions/checkout`, `actions/setup-node`, and `actions/stale`). This hardens the CI/CD pipeline by ensuring action dependencies are strictly immutable and prevents potential supply chain attacks.
2026-05-20 15:58:26 -04:00

53 lines
1.8 KiB
YAML

name: CI
on:
pull_request:
push:
branches: [main]
paths:
- "domains/*"
- "tests/*"
- "util/*"
- ".github/workflows/ci.yml"
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-ci
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: npm install
- 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 }}
- name: Run DNSControl tests
if: github.event_name == 'pull_request' && contains(fromJson(env.CHANGED_FILES), 'dnsconfig.js')
uses: is-a-dev/dnscontrol-action@main
with:
args: check
- name: Run tests
run: npx ava tests/*.test.js --timeout=1m