mirror of
https://github.com/multipleof4/.sune.git
synced 2026-01-14 16:07:54 +00:00
Create catalog.yml
This commit is contained in:
18
.github/workflows/catalog.yml
vendored
Normal file
18
.github/workflows/catalog.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
on: push
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
jobs:
|
||||||
|
c:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: |
|
||||||
|
echo "[" >catalog.json;c=;
|
||||||
|
for f in *.sune;do [ -f "$f" ]||continue;raw="https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$GITHUB_REF_NAME/$f";n=$(jq -r '.[0].name//empty' "$f" 2>/dev/null);a=$(jq -r '.[0].avatar//empty' "$f" 2>/dev/null);i=$(jq -r '.[0].id//empty' "$f" 2>/dev/null);jq -rn --arg name "${n:-$f}" --arg raw "$raw" --arg avatar "$a" --arg id "$i" '({name:$name,raw:$raw}+(if $avatar=="" then {} else {avatar:$avatar} end)+(if $id=="" then {} else {id:$id} end))'|sed "1s/^/$c /">>catalog.json;c=,;done
|
||||||
|
echo "]" >>catalog.json
|
||||||
|
t=$(mktemp);jq . catalog.json>"$t"&&mv "$t" catalog.json
|
||||||
|
git config user.name bot
|
||||||
|
git config user.email bot@users.noreply.github.com
|
||||||
|
git add catalog.json
|
||||||
|
git commit -m update || true
|
||||||
|
git push
|
||||||
Reference in New Issue
Block a user