Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/sync-device-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Sync device links

# Pulls the device-link catalog from msh.to's public /api/urls into data/deviceLinks.json,
# which the api serves from /resource/deviceLinks. Keeps the data in-repo (reviewable diffs,
# no runtime dependency on msh.to) and fresh without a code change.

on:
schedule:
- cron: "17 * * * *" # hourly (at :17 to avoid top-of-hour congestion)
workflow_dispatch:

concurrency:
group: sync-device-links
cancel-in-progress: false

permissions:
contents: write

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Fetch catalog from msh.to
run: |
set -euo pipefail
curl -fsSL https://msh.to/api/urls -o /tmp/catalog.json
# Sanity-check the shape before writing, so a bad/empty response never lands.
jq -e 'has("Routes") and (.Routes | type == "array") and (.Routes | length > 0)' /tmp/catalog.json >/dev/null
mkdir -p data
jq '.' /tmp/catalog.json > data/deviceLinks.json # pretty-print for clean diffs

- name: Commit if changed
run: |
set -euo pipefail
if git diff --quiet -- data/deviceLinks.json; then
echo "Catalog unchanged — nothing to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add data/deviceLinks.json
git commit -m "chore: sync device links from msh.to [skip ci]"
git push
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",

Check notice on line 2 in biome.json

View workflow job for this annotation

GitHub Actions / quality

deserialize

The configuration schema version does not match the CLI version 2.4.16
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"files": {
"ignoreUnknown": true
"ignoreUnknown": true,
"includes": ["**", "!data/**"]

Check warning on line 6 in biome.json

View workflow job for this annotation

GitHub Actions / quality

lint/suspicious/useBiomeIgnoreFolder

Incorrect usage of ignore a folder found.
},
"vcs": {
"enabled": true,
Expand Down
Loading
Loading