name: Specs verify on: push: branches: [develop, main] pull_request: types: [opened, synchronize, reopened] concurrency: group: specs-verify-${{ gitea.event_name }}-${{ gitea.event.pull_request.number || gitea.ref }} cancel-in-progress: true jobs: verify: runs-on: ubuntu-latest steps: - uses: https://github.com/actions/checkout@v4 with: fetch-depth: 0 - name: Check whitespace in committed range env: PR_BASE: ${{ github.event.pull_request.base.sha }} PR_HEAD: ${{ github.event.pull_request.head.sha }} PUSH_BEFORE: ${{ github.event.before }} PUSH_AFTER: ${{ github.sha }} run: | if [ -n "$PR_HEAD" ]; then range="$PR_BASE...$PR_HEAD" elif [ -n "$PUSH_BEFORE" ] && ! expr "$PUSH_BEFORE" : '0*$' >/dev/null; then range="$PUSH_BEFORE..$PUSH_AFTER" else # New branch / unknown before: only the pushed commit; full tree would hit read-only archives. range="$PUSH_AFTER^..$PUSH_AFTER" fi echo "Checked revision: $(git rev-parse HEAD); range: $range" git diff --check "$range" - uses: https://github.com/actions/setup-node@v4 with: node-version-file: .nvmrc - name: Install pinned OpenSpec CLI and lychee 0.24.2 run: | npm install -g "@fission-ai/openspec@$(cat openspec/.cli-version)" openspec store register . curl --fail --location --silent --show-error https://github.com/lycheeverse/lychee/releases/download/lychee-v0.24.2/lychee-x86_64-unknown-linux-gnu.tar.gz -o /tmp/lychee.tar.gz echo '1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a /tmp/lychee.tar.gz' | sha256sum --check tar -xzf /tmp/lychee.tar.gz -C /tmp echo /tmp/lychee-x86_64-unknown-linux-gnu >> "$GITHUB_PATH" env: OPENSPEC_TELEMETRY: '0' - name: Validate schemas, specs, changes and local links run: npm run validate env: OPENSPEC_TELEMETRY: '0'