forked from phpstan/phpstan
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.39 KB
/
algolia-crawler-config.yml
File metadata and controls
39 lines (33 loc) · 1.39 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
name: "Algolia Crawler Config Update"
on:
push:
branches:
- "2.2.x"
paths:
- '.github/workflows/algolia-crawler-config.json'
- '.github/workflows/algolia-crawler-config.yml'
permissions:
contents: read
jobs:
update-config:
name: "Update Algolia Crawler Config"
runs-on: "ubuntu-latest"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: "Update Crawler Config"
run: |
jq --arg key "${{ secrets.ALGOLIA_CRAWLER_CRAWLER_API_KEY }}" '.apiKey = $key' .github/workflows/algolia-crawler-config.json | \
curl -X PATCH "https://crawler.algolia.com/api/1/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/config" \
-H "Content-Type: application/json" \
-u "${{ secrets.ALGOLIA_CRAWLER_USER_ID }}:${{ secrets.ALGOLIA_CRAWLER_API_KEY }}" \
-d @-
- name: "Trigger Crawler Reindex"
run: |
curl -X POST "https://crawler.algolia.com/api/1/crawlers/${{ secrets.ALGOLIA_CRAWLER_ID }}/reindex" \
-H "Content-Type: application/json" \
-u "${{ secrets.ALGOLIA_CRAWLER_USER_ID }}:${{ secrets.ALGOLIA_CRAWLER_API_KEY }}"