-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.5 KB
/
algolia-integrity.yml
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
name: Algolia Integrity
on:
pull_request:
paths:
- 'website/**'
jobs:
algolia-records-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node 17
uses: actions/setup-node@v3
with:
node-version: 17
cache: 'yarn'
- name: Install Dependencies
run: yarn --ignore-engines
- name: Build Packages
run: yarn build
- name: Typecheck
run: yarn workspace website build
- name: Algolia generate
run: yarn workspace website algolia-sync
env:
ALGOLIA_DRY_RUN: true
SITE_URL: https://www.envelop.dev/
- name: Prettier
run: yarn prettier
- name: Compare
run: git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json
- name: Diff to file
if: always()
id: diff_result
run: |
OUTPUT=$(git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json)
OUTPUT="${OUTPUT//'%'/'%25'}"
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
echo "::set-output name=result::$OUTPUT"
- name: Publish a message
if: always() && contains(steps.diff_result.outputs.result, 'diff')
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
```diff
${{ steps.diff_result.outputs.result }}
```