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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,45 @@ jobs:
- run: npm test
- run: npm run build

changes:
name: Detect docs-only change
runs-on: ubuntu-latest
outputs:
app: ${{ steps.filter.outputs.app }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- id: filter
name: Check whether anything outside site/ changed
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
BASE_REF: ${{ github.base_ref }}
BEFORE_SHA: ${{ github.event.before }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
base="origin/$BASE_REF"
else
base="$BEFORE_SHA"
fi
if ! files=$(git diff --name-only "$base"...HEAD 2>/dev/null); then
echo "Could not compare with $base; running everything."
echo "app=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if printf '%s\n' "$files" | grep -qvE '^site/'; then
echo "app=true" >> "$GITHUB_OUTPUT"
else
echo "Only site/ changed; the native builds are skipped."
echo "app=false" >> "$GITHUB_OUTPUT"
fi

native:
# Docs-only changes skip the native builds. A skipped job still satisfies
# the required status check, so such pull requests can merge.
needs: changes
if: needs.changes.outputs.app == 'true'
strategy:
fail-fast: false
matrix:
Expand Down
Loading