Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: CI

on:
# No paths-ignore here: "Check" is a required check, so it must report on every
# pull request. Docs-only pull requests skip the job instead (see `changes`).
pull_request:
paths-ignore: &docs-only
push:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"
- "assets/**"
- "raycast/**"
- "demo.tape"
push:
branches:
- main
paths-ignore: *docs-only

permissions:
contents: read
Expand All @@ -25,8 +26,40 @@ env:
MACOSX_DEPLOYMENT_TARGET: "11.0"

jobs:
changes:
name: Detect changes
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
pull-requests: read
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
# Only GitHub-owned actions are allowed in this repository, so filter with the gh CLI.
- name: Filter changed paths
id: filter
shell: bash
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
files=$(gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" --jq '.[].filename')
code=false
while IFS= read -r file; do
case "$file" in
*.md | docs/* | assets/* | raycast/* | demo.tape | "") ;;
*) code=true ;;
esac
done <<< "$files"
echo "code=$code" >> "$GITHUB_OUTPUT"

check:
name: Check
needs: changes
# A skipped job still satisfies the required check, so docs-only pull requests can merge.
# Skip only when the filter ran and found no code changes; any other outcome runs the checks.
if: ${{ !cancelled() && !(needs.changes.result == 'success' && needs.changes.outputs.code == 'false') }}
# macos-15 is arm64, so the host target is the only one gbat ships.
runs-on: macos-15
timeout-minutes: 15
Expand Down
Loading