Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scalvert/glean-collections-sync
Automatic syncing of search results into a collection in Glean
https://github.com/scalvert/glean-collections-sync
Last synced: 2 months ago
JSON representation
Automatic syncing of search results into a collection in Glean
- Host: GitHub
- URL: https://github.com/scalvert/glean-collections-sync
- Owner: scalvert
- License: mit
- Created: 2024-07-14T21:24:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-30T09:25:54.000Z (3 months ago)
- Last Synced: 2024-10-09T12:35:45.117Z (3 months ago)
- Language: TypeScript
- Size: 350 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# glean-collections-sync
## Description
Automatic syncing of search results into a collection in Glean
## Usage
Create a new file called `.github/workflows/glean-collections-sync.yml` in your repository with the following contents:
```yaml
name: Sync Collectionson:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
workflow_dispatch: # Allows for manual triggeringjobs:
sync_collections:
runs-on: ubuntu-lateststeps:
- name: Checkout repository
uses: actions/checkout@v2- name: Sync collections
uses: scalvert/glean-collections-sync@v1
with:
glean-client-api-url: ${{ secrets.GLEAN_CLIENT_API_URL }}
glean-client-api-token: ${{ secrets.GLEAN_CLIENT_API_TOKEN }}
glean-user-email: ${{ secrets.GLEAN_USER_EMAIL }}
collection-sync-configs: '[{"name": "collection-name-1", "query": "query-1", "filters": "filters-1"}, {"name": "collection-name-2", "query": "query-2", "filters": "filters-2"}]'
```The `collection-sync-configs` input should be a JSON string representing an array of collections, each with a name, query, and filters. For example:
```json
[
{
"name": "my-collection",
"query": "github actions",
"filters": "app:github"
},
{
"name": "my-github-pages-site",
"query": "",
"filters": "app:github type:page repository:my-repo"
}
]
```## Inputs
| name | description | required | default |
| ------------------------- | -------------------------------------------------------------------------- | -------- | ------- |
| `glean-client-api-url` |Glean client API URL
| `true` | `""` |
| `glean-client-api-token` |Glean client API token
| `true` | `""` |
| `glean-user-email` |Glean user email on whose behalf the request is intended to be made
| `true` | `""` |
| `collection-sync-configs` |JSON array of collections, each with name, query, and filters
| `true` | `""` |## Outputs
| name | description |
| -------- | ----------------------------------- |
| `result` |Result of the sync operation
|## Runs
This action is a `node20` action.