Repository navigation
feat: refresh native review previews and verify syntax roles #9
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: check | |
| on: [push, pull_request, workflow_dispatch] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: check-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: { node-version: 24 } | |
| - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 | |
| with: { version: 12.9.0, run_install: false } | |
| - uses: cachix/install-nix-action@448cde739abec1eaf0646249e3d25bb8d9bc7702 # v31 | |
| - run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Automatically capture missing or stale application previews | |
| run: | | |
| if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then | |
| pnpm screenshots -- --force | |
| elif ! pnpm screenshots:check; then | |
| pnpm screenshots | |
| fi | |
| - run: pnpm check | |
| - run: pnpm test | |
| - run: pnpm package | |
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: living-code-opencode | |
| path: dist/*.tar.gz | |
| if-no-files-found: error | |
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: native-previews-opencode | |
| path: images/ | |
| if-no-files-found: error | |
| - name: Commit only validated capture updates on main | |
| if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| git add -- images | |
| if git diff --cached --quiet; then exit 0; fi | |
| remote_head="$(git ls-remote origin refs/heads/main | cut -f1)" | |
| if [ "$remote_head" != "$GITHUB_SHA" ]; then | |
| echo 'Main advanced during capture; its newer run owns publication.' | |
| exit 0 | |
| fi | |
| git -c user.name='github-actions[bot]' -c user.email='41898282+github-actions[bot]@users.noreply.github.com' commit -m 'chore: refresh native theme captures' | |
| authorization="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 -w0)" | |
| git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $authorization" push origin HEAD:main |