1
0
mirror of synced 2025-12-30 12:02:01 -05:00

workflow_dispatch version input for sync search (#32207)

This commit is contained in:
Peter Bengtsson
2022-11-01 21:24:58 +01:00
committed by GitHub
parent fe491f1cda
commit 96ae1fa44d
2 changed files with 44 additions and 2 deletions

View File

@@ -7,6 +7,11 @@ name: Sync search Elasticsearch
on:
workflow_dispatch:
inputs:
version:
description: "Version to exclusively generate the search index for. E.g. 'dotcom', 'ghes-3.7', 'ghae'"
required: false
default: ''
schedule:
- cron: '23 */4 * * *' # Run every 4 hours at 23 minutes past the hour
@@ -88,6 +93,10 @@ jobs:
# let's just accept an empty string instead.
THROW_ON_EMPTY: false
# Note that by default, this is '' (empty string) and that means
# the same as not set within the script.
VERSION: ${{ github.event.inputs.version }}
run: |
mkdir /tmp/records
npm run sync-search-indices -- \
@@ -102,6 +111,11 @@ jobs:
curl --fail --retry-connrefused --retry 5 -I ${{ env.ELASTICSEARCH_URL }}
- name: Index into Elasticsearch
env:
# Must match what we used when scraping (npm run sync-search-indices)
# otherwise the script will seek other versions from disk that might
# not exist.
VERSION: ${{ github.event.inputs.version }}
run: |
./script/search/index-elasticsearch.js \
--language ${{ matrix.language }} -- /tmp/records