Repository navigation
58 lines (58 loc) · 2.45 KB
/
Copy pathcheck.yml
File metadata and controls
58 lines (58 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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